--TEST-- Check for libsodium stream --EXTENSIONS-- sodium --SKIPIF-- --FILE-- getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20($len, substr($nonce, 1), $key); } catch (SodiumException $ex) { echo $ex->getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20($len, $nonce, substr($key, 1)); } catch (SodiumException $ex) { echo $ex->getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20_xor($stream, substr($nonce, 1), $key); } catch (SodiumException $ex) { echo $ex->getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20_xor($stream, $nonce, substr($key, 1)); } catch (SodiumException $ex) { echo $ex->getMessage(), "\n"; } ?> --EXPECT-- int(100) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) sodium_crypto_stream_xchacha20(): Argument #1 ($length) must be greater than 0 sodium_crypto_stream_xchacha20(): Argument #2 ($nonce) must be SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long sodium_crypto_stream_xchacha20(): Argument #3 ($key) must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long sodium_crypto_stream_xchacha20_xor(): Argument #2 ($nonce) must be SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long sodium_crypto_stream_xchacha20_xor(): Argument #3 ($key) must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long