summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/cipher_tests.inc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/tests/cipher_tests.inc')
-rw-r--r--ext/openssl/tests/cipher_tests.inc53
1 files changed, 52 insertions, 1 deletions
diff --git a/ext/openssl/tests/cipher_tests.inc b/ext/openssl/tests/cipher_tests.inc
index 779bfa8515..1d4988c5a8 100644
--- a/ext/openssl/tests/cipher_tests.inc
+++ b/ext/openssl/tests/cipher_tests.inc
@@ -108,7 +108,58 @@ $php_openssl_cipher_tests = array(
'01e4a9a4fba43c90ccdcb281d48c7c6f' .
'd62875d2aca417034c34aee5',
),
- )
+ ),
+ // First few test vectors from RFC 7253.
+ 'aes-128-ocb' => array(
+ array(
+ 'key' => '000102030405060708090A0B0C0D0E0F',
+ 'iv' => 'BBAA99887766554433221100',
+ 'aad' => '',
+ 'pt' => '',
+ 'tag' => '785407BFFFC8AD9EDCC5520AC9111EE6',
+ 'ct' => '',
+ ),
+ array(
+ 'key' => '000102030405060708090A0B0C0D0E0F',
+ 'iv' => 'BBAA99887766554433221101',
+ 'aad' => '0001020304050607',
+ 'pt' => '0001020304050607',
+ 'tag' => '5725BDA0D3B4EB3A257C9AF1F8F03009',
+ 'ct' => '6820B3657B6F615A',
+ ),
+ array(
+ 'key' => '000102030405060708090A0B0C0D0E0F',
+ 'iv' => 'BBAA99887766554433221102',
+ 'aad' => '0001020304050607',
+ 'pt' => '',
+ 'tag' => '81017F8203F081277152FADE694A0A00',
+ 'ct' => '',
+ ),
+ array(
+ 'key' => '000102030405060708090A0B0C0D0E0F',
+ 'iv' => 'BBAA99887766554433221103',
+ 'aad' => '',
+ 'pt' => '0001020304050607',
+ 'tag' => '14054CD1F35D82760B2CD00D2F99BFA9',
+ 'ct' => '45DD69F8F5AAE724',
+ ),
+ array(
+ 'key' => '000102030405060708090A0B0C0D0E0F',
+ 'iv' => 'BBAA99887766554433221104',
+ 'aad' => '000102030405060708090A0B0C0D0E0F',
+ 'pt' => '000102030405060708090A0B0C0D0E0F',
+ 'tag' => '3AD7A4FF3835B8C5701C1CCEC8FC3358',
+ 'ct' => '571D535B60B277188BE5147170A9A22C',
+ ),
+ array(
+ 'key' => '0F0E0D0C0B0A09080706050403020100',
+ 'iv' => 'BBAA9988776655443322110D',
+ 'aad' => '000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627',
+ 'pt' => '000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627',
+ 'tag' => 'D0C515F4D1CDD4FDAC4F02AA',
+ 'ct' => '1792A4E31E0755FB03E31B22116E6C2DDF9EFD6E33D536F1A0124B0A55BAE884ED93481529C76B6A',
+ ),
+ ),
);
function openssl_get_cipher_tests($method)