paragonie / sodium_compat

Pure PHP polyfill for ext/sodium

Home Page:https://paragonie.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sodium_crypto_sign_open can also return false

opened this issue · comments

commented

Yeah, the compat APIs are going to need to be API-consistent, but ParagonIE_Sodium_Compat will continue to return a string OR throw an exception. I'll do this in v1.3.0.

commented

/**
* @param string $message
* @param string $kp
* @return string|bool
*/
function sodium_crypto_box_seal_open($message, $kp)
{
try {
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
return false;
}
}

This will fixed in version 1.3.0.