--TEST-- openssl_decrypt() with SIV cipher algorithm tests --EXTENSIONS-- openssl --SKIPIF-- --FILE-- $test) { echo "TEST $idx\n"; $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, $test['iv'], $test['tag'], $test['aad']); var_dump($test['pt'] === $pt); } // failed because no AAD echo "TEST AAD\n"; var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, $test['iv'], $test['tag'])); // failed because wrong tag echo "TEST WRONGTAG\n"; var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, $test['iv'], str_repeat('x', 16), $test['aad'])); ?> --EXPECTF-- TEST 0 bool(true) TEST 1 bool(true) TEST 2 bool(true) TEST AAD bool(false) TEST WRONGTAG bool(false)