diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2019-09-19 15:38:51 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2019-09-19 15:38:51 +1000 |
commit | 105dde2528d64b4af25c241288a985fdfc27afbc (patch) | |
tree | ed797163af31f173bc5d5a6c223206829ebed91a /test | |
parent | 639b53ecd82648fbb66a2ab7dabece7f15a1f730 (diff) |
Add sm4 ciphers to default provider
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9935)
Diffstat (limited to 'test')
-rw-r--r-- | test/recipes/30-test_evp.t | 3 | ||||
-rw-r--r-- | test/recipes/30-test_evp_data/evpciph.txt | 31 | ||||
-rw-r--r-- | test/recipes/30-test_evp_data/evpciph_sm4.txt | 39 |
3 files changed, 42 insertions, 31 deletions
diff --git a/test/recipes/30-test_evp.t b/test/recipes/30-test_evp.t index bee446c1c8..486281772c 100644 --- a/test/recipes/30-test_evp.t +++ b/test/recipes/30-test_evp.t @@ -41,6 +41,9 @@ push @defltfiles, @castfiles unless disabled("cast"); my @seedfiles = qw( evpciph_seed.txt ); push @defltfiles, @seedfiles unless disabled("seed"); +my @sm4files = qw( evpciph_sm4.txt ); +push @defltfiles, @sm4files unless disabled("sm4"); + plan tests => (scalar(@configs) * scalar(@files)) + scalar(@defltfiles) + 1; my $infile = bldtop_file('providers', platform->dso('fips')); diff --git a/test/recipes/30-test_evp_data/evpciph.txt b/test/recipes/30-test_evp_data/evpciph.txt index b32d57d481..b180723188 100644 --- a/test/recipes/30-test_evp_data/evpciph.txt +++ b/test/recipes/30-test_evp_data/evpciph.txt @@ -2256,37 +2256,6 @@ Operation = ENCRYPT Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223 Ciphertext = A4DA23FCE6A5FFAA6D64AE9A0652A42CD161A34B65F9679F75C01F101F71276F15EF0D8D -Title = SM4 test vectors from IETF draft-ribose-cfrg-sm4 - -Cipher = SM4-ECB -Key = 0123456789ABCDEFFEDCBA9876543210 -Plaintext = 0123456789ABCDEFFEDCBA9876543210 -Ciphertext = 681EDF34D206965E86B3E94F536E4246 - -Cipher = SM4-CBC -Key = 0123456789ABCDEFFEDCBA9876543210 -IV = 0123456789ABCDEFFEDCBA9876543210 -Plaintext = 0123456789ABCDEFFEDCBA98765432100123456789ABCDEFFEDCBA9876543210 -Ciphertext = 2677F46B09C122CC975533105BD4A22AF6125F7275CE552C3A2BBCF533DE8A3B - -Cipher = SM4-OFB -Key = 0123456789ABCDEFFEDCBA9876543210 -IV = 0123456789ABCDEFFEDCBA9876543210 -Plaintext = 0123456789ABCDEFFEDCBA98765432100123456789ABCDEFFEDCBA9876543210 -Ciphertext = 693D9A535BAD5BB1786F53D7253A7056F2075D28B5235F58D50027E4177D2BCE - -Cipher = SM4-CFB -Key = 0123456789ABCDEFFEDCBA9876543210 -IV = 0123456789ABCDEFFEDCBA9876543210 -Plaintext = 0123456789ABCDEFFEDCBA98765432100123456789ABCDEFFEDCBA9876543210 -Ciphertext = 693D9A535BAD5BB1786F53D7253A70569ED258A85A0467CC92AAB393DD978995 - -Cipher = SM4-CTR -Key = 0123456789ABCDEFFEDCBA9876543210 -IV = 0123456789ABCDEFFEDCBA9876543210 -Plaintext = AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAA -Ciphertext = C2B4759E78AC3CF43D0852F4E8D5F9FD7256E8A5FCB65A350EE00630912E44492A0B17E1B85B060D0FBA612D8A95831638B361FD5FFACD942F081485A83CA35D - Title = ARIA test vectors from RFC5794 (and others) Cipher = ARIA-128-ECB diff --git a/test/recipes/30-test_evp_data/evpciph_sm4.txt b/test/recipes/30-test_evp_data/evpciph_sm4.txt new file mode 100644 index 0000000000..8434ccb6e2 --- /dev/null +++ b/test/recipes/30-test_evp_data/evpciph_sm4.txt @@ -0,0 +1,39 @@ +# +# Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved. +# +# Licensed under the Apache License 2.0 (the "License"). You may not use +# this file except in compliance with the License. You can obtain a copy +# in the file LICENSE in the source distribution or at +# https://www.openssl.org/source/license.html + + +Title = SM4 test vectors from IETF draft-ribose-cfrg-sm4 + +Cipher = SM4-ECB +Key = 0123456789ABCDEFFEDCBA9876543210 +Plaintext = 0123456789ABCDEFFEDCBA9876543210 +Ciphertext = 681EDF34D206965E86B3E94F536E4246 + +Cipher = SM4-CBC +Key = 0123456789ABCDEFFEDCBA9876543210 +IV = 0123456789ABCDEFFEDCBA9876543210 +Plaintext = 0123456789ABCDEFFEDCBA98765432100123456789ABCDEFFEDCBA9876543210 +Ciphertext = 2677F46B09C122CC975533105BD4A22AF6125F7275CE552C3A2BBCF533DE8A3B + +Cipher = SM4-OFB +Key = 0123456789ABCDEFFEDCBA9876543210 +IV = 0123456789ABCDEFFEDCBA9876543210 +Plaintext = 0123456789ABCDEFFEDCBA98765432100123456789ABCDEFFEDCBA9876543210 +Ciphertext = 693D9A535BAD5BB1786F53D7253A7056F2075D28B5235F58D50027E4177D2BCE + +Cipher = SM4-CFB +Key = 0123456789ABCDEFFEDCBA9876543210 +IV = 0123456789ABCDEFFEDCBA9876543210 +Plaintext = 0123456789ABCDEFFEDCBA98765432100123456789ABCDEFFEDCBA9876543210 +Ciphertext = 693D9A535BAD5BB1786F53D7253A70569ED258A85A0467CC92AAB393DD978995 + +Cipher = SM4-CTR +Key = 0123456789ABCDEFFEDCBA9876543210 +IV = 0123456789ABCDEFFEDCBA9876543210 +Plaintext = AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAA +Ciphertext = C2B4759E78AC3CF43D0852F4E8D5F9FD7256E8A5FCB65A350EE00630912E44492A0B17E1B85B060D0FBA612D8A95831638B361FD5FFACD942F081485A83CA35D |