PATH:
opt
/
alt
/
tests
/
alt-php55-pecl-libsodium_1.0.6-1.el8
/
tests
--TEST-- Check for libsodium secretbox --SKIPIF-- <?php if (!extension_loaded("libsodium")) print "skip"; ?> --FILE-- <?php $nonce = \Sodium\randombytes_buf(\Sodium\CRYPTO_SECRETBOX_NONCEBYTES); $key = \Sodium\randombytes_buf(\Sodium\CRYPTO_SECRETBOX_KEYBYTES); $a = \Sodium\crypto_secretbox('test', $nonce, $key); $x = \Sodium\crypto_secretbox_open($a, $nonce, $key); var_dump(bin2hex($x)); $y = \Sodium\crypto_secretbox_open("\0" . $a, $nonce, $key); var_dump($y); ?> --EXPECT-- string(8) "74657374" bool(false)
[-] crypto_hex.phpt
[edit]
[-] pwhash_scrypt.phpt
[edit]
[-] crypto_generichash.phpt
[edit]
[-] crypto_auth.phpt
[edit]
[-] randombytes.phpt
[edit]
[-] crypto_secretbox.phpt
[edit]
[-] crypto_aead.phpt
[edit]
[-] crypto_kx.phpt
[edit]
[-] crypto_box.phpt
[edit]
[-] crypto_scalarmult.phpt
[edit]
[-] installed.phpt
[edit]
[-] crypto_sign.phpt
[edit]
[+]
..
[-] version.phpt
[edit]
[-] crypto_stream.phpt
[edit]
[-] crypto_shorthash.phpt
[edit]
[-] utils.phpt
[edit]