Lines Matching refs:hash_hmac

2 Test hash_hmac() function : basic functionality
8 * proto string hash_hmac ( string algo, string data, string key [, bool raw_output] )
12 echo "*** Testing hash_hmac() : error conditions ***\n";
14 $data = "This is a sample string used to test the hash_hmac function with various hashing algorithm…
17 echo "\n-- Testing hash_hmac() function with less than expected no. of arguments --\n";
18 var_dump(hash_hmac());
19 var_dump(hash_hmac('md5'));
20 var_dump(hash_hmac('md5', $data));
22 echo "\n-- Testing hash_hmac() function with more than expected no. of arguments --\n";
24 var_dump(hash_hmac('md5', $data, $key, TRUE, $extra_arg));
26 echo "\n-- Testing hash_hmac() function with invalid hash algorithm --\n";
27 var_dump(hash_hmac('foo', $data, $key));
29 echo "\n-- Testing hash_hmac() function with non-cryptographic hash algorithm --\n";
30 var_dump(hash_hmac('crc32', $data, $key));
35 *** Testing hash_hmac() : error conditions ***
37 -- Testing hash_hmac() function with less than expected no. of arguments --
39 Warning: hash_hmac() expects at least 3 parameters, 0 given in %s on line %d
42 Warning: hash_hmac() expects at least 3 parameters, 1 given in %s on line %d
45 Warning: hash_hmac() expects at least 3 parameters, 2 given in %s on line %d
48 -- Testing hash_hmac() function with more than expected no. of arguments --
50 Warning: hash_hmac() expects at most 4 parameters, 5 given in %s on line %d
53 -- Testing hash_hmac() function with invalid hash algorithm --
55 Warning: hash_hmac(): Unknown hashing algorithm: foo in %s on line %d
58 -- Testing hash_hmac() function with non-cryptographic hash algorithm --
60 Warning: hash_hmac(): Non-cryptographic hashing algorithm: crc32 in %s on line %d