PATH:
opt
/
alt
/
tests
/
alt-php71-pecl-libsodium_2.0.23-1.el8
/
tests
--TEST-- Check for libsodium shorthash --SKIPIF-- <?php if (!extension_loaded("sodium")) print "skip"; ?> --FILE-- <?php $m1 = 'message'; $k1 = '0123456789ABCDEF'; $h1 = sodium_crypto_shorthash($m1, $k1); echo sodium_bin2hex($h1) . "\n"; $k2 = '0123456789abcdef'; $h2 = sodium_crypto_shorthash($m1, $k2); echo sodium_bin2hex($h2) . "\n"; $m2 = 'msg'; $h3 = sodium_crypto_shorthash($m2, $k2); echo sodium_bin2hex($h3) . "\n"; try { sodium_crypto_shorthash($m1, $k1 . $k2); } catch (SodiumException $ex) { var_dump(true); } ?> --EXPECT-- e0ad6fdbf8b9a191 c667b37af201a2d9 d27fa3fc70b45b72 bool(true)
[-] crypto_hex.phpt
[edit]
[-] crypto_generichash.phpt
[edit]
[-] crypto_auth.phpt
[edit]
[-] crypto_secretstream.phpt
[edit]
[-] crypto_secretbox.phpt
[edit]
[-] pwhash_argon2i.phpt
[edit]
[-] crypto_aead.phpt
[edit]
[-] crypto_kx.phpt
[edit]
[-] crypto_box.phpt
[edit]
[-] crypto_scalarmult.phpt
[edit]
[-] installed.phpt
[edit]
[-] exception_trace_without_args.phpt
[edit]
[-] crypto_kdf.phpt
[edit]
[-] crypto_sign.phpt
[edit]
[+]
..
[-] version.phpt
[edit]
[-] inc_add.phpt
[edit]
[-] crypto_stream.phpt
[edit]
[-] crypto_shorthash.phpt
[edit]
[-] utils.phpt
[edit]