diff options
author | Jarod Wilson <jarod@redhat.com> | 2009-05-04 07:23:40 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-06-02 00:04:36 -0400 |
commit | 5d667322a25ab4ecb91176db118fd663fee4da35 (patch) | |
tree | 0dea05fd2e59b7854370a871fb8f9bb30e5ed94e /crypto | |
parent | e44a1b44c3a9794236fe038b89a0fbef5adcd523 (diff) |
crypto: testmgr - Add self-tests for rfc4309(ccm(aes))
Add an array of encryption and decryption + verification self-tests
for rfc4309(ccm(aes)).
Test vectors all come from sample FIPS CAVS files provided to
Red Hat by a testing lab. Unfortunately, all the published sample
vectors in RFC 3610 and NIST Special Publication 800-38C contain nonce
lengths that the kernel's rfc4309 implementation doesn't support, so
while using some public domain vectors would have been preferred, its
not possible at this time.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/tcrypt.c | 4 | ||||
-rw-r--r-- | crypto/testmgr.c | 15 | ||||
-rw-r--r-- | crypto/testmgr.h | 370 |
3 files changed, 389 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 50d1e35bbff4..0452036b1d45 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -667,6 +667,10 @@ static void do_test(int m) | |||
667 | tcrypt_test("zlib"); | 667 | tcrypt_test("zlib"); |
668 | break; | 668 | break; |
669 | 669 | ||
670 | case 45: | ||
671 | tcrypt_test("rfc4309(ccm(aes))"); | ||
672 | break; | ||
673 | |||
670 | case 100: | 674 | case 100: |
671 | tcrypt_test("hmac(md5)"); | 675 | tcrypt_test("hmac(md5)"); |
672 | break; | 676 | break; |
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 84f96401b29a..40c10789f7f3 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -1879,6 +1879,21 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1879 | } | 1879 | } |
1880 | } | 1880 | } |
1881 | }, { | 1881 | }, { |
1882 | .alg = "rfc4309(ccm(aes))", | ||
1883 | .test = alg_test_aead, | ||
1884 | .suite = { | ||
1885 | .aead = { | ||
1886 | .enc = { | ||
1887 | .vecs = aes_ccm_rfc4309_enc_tv_template, | ||
1888 | .count = AES_CCM_4309_ENC_TEST_VECTORS | ||
1889 | }, | ||
1890 | .dec = { | ||
1891 | .vecs = aes_ccm_rfc4309_dec_tv_template, | ||
1892 | .count = AES_CCM_4309_DEC_TEST_VECTORS | ||
1893 | } | ||
1894 | } | ||
1895 | } | ||
1896 | }, { | ||
1882 | .alg = "rmd128", | 1897 | .alg = "rmd128", |
1883 | .test = alg_test_hash, | 1898 | .test = alg_test_hash, |
1884 | .suite = { | 1899 | .suite = { |
diff --git a/crypto/testmgr.h b/crypto/testmgr.h index b77b61dad262..5add65196a98 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h | |||
@@ -2848,6 +2848,8 @@ static struct cipher_testvec cast6_dec_tv_template[] = { | |||
2848 | #define AES_GCM_DEC_TEST_VECTORS 8 | 2848 | #define AES_GCM_DEC_TEST_VECTORS 8 |
2849 | #define AES_CCM_ENC_TEST_VECTORS 7 | 2849 | #define AES_CCM_ENC_TEST_VECTORS 7 |
2850 | #define AES_CCM_DEC_TEST_VECTORS 7 | 2850 | #define AES_CCM_DEC_TEST_VECTORS 7 |
2851 | #define AES_CCM_4309_ENC_TEST_VECTORS 7 | ||
2852 | #define AES_CCM_4309_DEC_TEST_VECTORS 10 | ||
2851 | 2853 | ||
2852 | static struct cipher_testvec aes_enc_tv_template[] = { | 2854 | static struct cipher_testvec aes_enc_tv_template[] = { |
2853 | { /* From FIPS-197 */ | 2855 | { /* From FIPS-197 */ |
@@ -5826,6 +5828,374 @@ static struct aead_testvec aes_ccm_dec_tv_template[] = { | |||
5826 | }, | 5828 | }, |
5827 | }; | 5829 | }; |
5828 | 5830 | ||
5831 | /* | ||
5832 | * rfc4309 refers to section 8 of rfc3610 for test vectors, but they all | ||
5833 | * use a 13-byte nonce, we only support an 11-byte nonce. Similarly, all of | ||
5834 | * Special Publication 800-38C's test vectors also use nonce lengths our | ||
5835 | * implementation doesn't support. The following are taken from fips cavs | ||
5836 | * fax files on hand at Red Hat. | ||
5837 | * | ||
5838 | * nb: actual key lengths are (klen - 3), the last 3 bytes are actually | ||
5839 | * part of the nonce which combine w/the iv, but need to be input this way. | ||
5840 | */ | ||
5841 | static struct aead_testvec aes_ccm_rfc4309_enc_tv_template[] = { | ||
5842 | { | ||
5843 | .key = "\x83\xac\x54\x66\xc2\xeb\xe5\x05" | ||
5844 | "\x2e\x01\xd1\xfc\x5d\x82\x66\x2e" | ||
5845 | "\x96\xac\x59", | ||
5846 | .klen = 19, | ||
5847 | .iv = "\x30\x07\xa1\xe2\xa2\xc7\x55\x24", | ||
5848 | .alen = 0, | ||
5849 | .input = "\x19\xc8\x81\xf6\xe9\x86\xff\x93" | ||
5850 | "\x0b\x78\x67\xe5\xbb\xb7\xfc\x6e" | ||
5851 | "\x83\x77\xb3\xa6\x0c\x8c\x9f\x9c" | ||
5852 | "\x35\x2e\xad\xe0\x62\xf9\x91\xa1", | ||
5853 | .ilen = 32, | ||
5854 | .result = "\xab\x6f\xe1\x69\x1d\x19\x99\xa8" | ||
5855 | "\x92\xa0\xc4\x6f\x7e\xe2\x8b\xb1" | ||
5856 | "\x70\xbb\x8c\xa6\x4c\x6e\x97\x8a" | ||
5857 | "\x57\x2b\xbe\x5d\x98\xa6\xb1\x32" | ||
5858 | "\xda\x24\xea\xd9\xa1\x39\x98\xfd" | ||
5859 | "\xa4\xbe\xd9\xf2\x1a\x6d\x22\xa8", | ||
5860 | .rlen = 48, | ||
5861 | }, { | ||
5862 | .key = "\x1e\x2c\x7e\x01\x41\x9a\xef\xc0" | ||
5863 | "\x0d\x58\x96\x6e\x5c\xa2\x4b\xd3" | ||
5864 | "\x4f\xa3\x19", | ||
5865 | .klen = 19, | ||
5866 | .iv = "\xd3\x01\x5a\xd8\x30\x60\x15\x56", | ||
5867 | .assoc = "\xda\xe6\x28\x9c\x45\x2d\xfd\x63" | ||
5868 | "\x5e\xda\x4c\xb6\xe6\xfc\xf9\xb7" | ||
5869 | "\x0c\x56\xcb\xe4\xe0\x05\x7a\xe1" | ||
5870 | "\x0a\x63\x09\x78\xbc\x2c\x55\xde", | ||
5871 | .alen = 32, | ||
5872 | .input = "\x87\xa3\x36\xfd\x96\xb3\x93\x78" | ||
5873 | "\xa9\x28\x63\xba\x12\xa3\x14\x85" | ||
5874 | "\x57\x1e\x06\xc9\x7b\x21\xef\x76" | ||
5875 | "\x7f\x38\x7e\x8e\x29\xa4\x3e\x7e", | ||
5876 | .ilen = 32, | ||
5877 | .result = "\x8a\x1e\x11\xf0\x02\x6b\xe2\x19" | ||
5878 | "\xfc\x70\xc4\x6d\x8e\xb7\x99\xab" | ||
5879 | "\xc5\x4b\xa2\xac\xd3\xf3\x48\xff" | ||
5880 | "\x3b\xb5\xce\x53\xef\xde\xbb\x02" | ||
5881 | "\xa9\x86\x15\x6c\x13\xfe\xda\x0a" | ||
5882 | "\x22\xb8\x29\x3d\xd8\x39\x9a\x23", | ||
5883 | .rlen = 48, | ||
5884 | }, { | ||
5885 | .key = "\xf4\x6b\xc2\x75\x62\xfe\xb4\xe1" | ||
5886 | "\xa3\xf0\xff\xdd\x4e\x4b\x12\x75" | ||
5887 | "\x53\x14\x73\x66\x8d\x88\xf6\x80" | ||
5888 | "\xa0\x20\x35", | ||
5889 | .klen = 27, | ||
5890 | .iv = "\x26\xf2\x21\x8d\x50\x20\xda\xe2", | ||
5891 | .assoc = "\x5b\x9e\x13\x67\x02\x5e\xef\xc1" | ||
5892 | "\x6c\xf9\xd7\x1e\x52\x8f\x7a\x47" | ||
5893 | "\xe9\xd4\xcf\x20\x14\x6e\xf0\x2d" | ||
5894 | "\xd8\x9e\x2b\x56\x10\x23\x56\xe7", | ||
5895 | .alen = 32, | ||
5896 | .ilen = 0, | ||
5897 | .result = "\x36\xea\x7a\x70\x08\xdc\x6a\xbc" | ||
5898 | "\xad\x0c\x7a\x63\xf6\x61\xfd\x9b", | ||
5899 | .rlen = 16, | ||
5900 | }, { | ||
5901 | .key = "\x56\xdf\x5c\x8f\x26\x3f\x0e\x42" | ||
5902 | "\xef\x7a\xd3\xce\xfc\x84\x60\x62" | ||
5903 | "\xca\xb4\x40\xaf\x5f\xc9\xc9\x01" | ||
5904 | "\xd6\x3c\x8c", | ||
5905 | .klen = 27, | ||
5906 | .iv = "\x86\x84\xb6\xcd\xef\x09\x2e\x94", | ||
5907 | .assoc = "\x02\x65\x78\x3c\xe9\x21\x30\x91" | ||
5908 | "\xb1\xb9\xda\x76\x9a\x78\x6d\x95" | ||
5909 | "\xf2\x88\x32\xa3\xf2\x50\xcb\x4c" | ||
5910 | "\xe3\x00\x73\x69\x84\x69\x87\x79", | ||
5911 | .alen = 32, | ||
5912 | .input = "\x9f\xd2\x02\x4b\x52\x49\x31\x3c" | ||
5913 | "\x43\x69\x3a\x2d\x8e\x70\xad\x7e" | ||
5914 | "\xe0\xe5\x46\x09\x80\x89\x13\xb2" | ||
5915 | "\x8c\x8b\xd9\x3f\x86\xfb\xb5\x6b", | ||
5916 | .ilen = 32, | ||
5917 | .result = "\x39\xdf\x7c\x3c\x5a\x29\xb9\x62" | ||
5918 | "\x5d\x51\xc2\x16\xd8\xbd\x06\x9f" | ||
5919 | "\x9b\x6a\x09\x70\xc1\x51\x83\xc2" | ||
5920 | "\x66\x88\x1d\x4f\x9a\xda\xe0\x1e" | ||
5921 | "\xc7\x79\x11\x58\xe5\x6b\x20\x40" | ||
5922 | "\x7a\xea\x46\x42\x8b\xe4\x6f\xe1", | ||
5923 | .rlen = 48, | ||
5924 | }, { | ||
5925 | .key = "\xe0\x8d\x99\x71\x60\xd7\x97\x1a" | ||
5926 | "\xbd\x01\x99\xd5\x8a\xdf\x71\x3a" | ||
5927 | "\xd3\xdf\x24\x4b\x5e\x3d\x4b\x4e" | ||
5928 | "\x30\x7a\xb9\xd8\x53\x0a\x5e\x2b" | ||
5929 | "\x1e\x29\x91", | ||
5930 | .klen = 35, | ||
5931 | .iv = "\xad\x8e\xc1\x53\x0a\xcf\x2d\xbe", | ||
5932 | .assoc = "\x19\xb6\x1f\x57\xc4\xf3\xf0\x8b" | ||
5933 | "\x78\x2b\x94\x02\x29\x0f\x42\x27" | ||
5934 | "\x6b\x75\xcb\x98\x34\x08\x7e\x79" | ||
5935 | "\xe4\x3e\x49\x0d\x84\x8b\x22\x87", | ||
5936 | .alen = 32, | ||
5937 | .input = "\xe1\xd9\xd8\x13\xeb\x3a\x75\x3f" | ||
5938 | "\x9d\xbd\x5f\x66\xbe\xdc\xbb\x66" | ||
5939 | "\xbf\x17\x99\x62\x4a\x39\x27\x1f" | ||
5940 | "\x1d\xdc\x24\xae\x19\x2f\x98\x4c", | ||
5941 | .ilen = 32, | ||
5942 | .result = "\x19\xb8\x61\x33\x45\x2b\x43\x96" | ||
5943 | "\x6f\x51\xd0\x20\x30\x7d\x9b\xc6" | ||
5944 | "\x26\x3d\xf8\xc9\x65\x16\xa8\x9f" | ||
5945 | "\xf0\x62\x17\x34\xf2\x1e\x8d\x75" | ||
5946 | "\x4e\x13\xcc\xc0\xc3\x2a\x54\x2d", | ||
5947 | .rlen = 40, | ||
5948 | }, { | ||
5949 | .key = "\x7c\xc8\x18\x3b\x8d\x99\xe0\x7c" | ||
5950 | "\x45\x41\xb8\xbd\x5c\xa7\xc2\x32" | ||
5951 | "\x8a\xb8\x02\x59\xa4\xfe\xa9\x2c" | ||
5952 | "\x09\x75\x9a\x9b\x3c\x9b\x27\x39" | ||
5953 | "\xf9\xd9\x4e", | ||
5954 | .klen = 35, | ||
5955 | .iv = "\x63\xb5\x3d\x9d\x43\xf6\x1e\x50", | ||
5956 | .assoc = "\x57\xf5\x6b\x8b\x57\x5c\x3d\x3b" | ||
5957 | "\x13\x02\x01\x0c\x83\x4c\x96\x35" | ||
5958 | "\x8e\xd6\x39\xcf\x7d\x14\x9b\x94" | ||
5959 | "\xb0\x39\x36\xe6\x8f\x57\xe0\x13", | ||
5960 | .alen = 32, | ||
5961 | .input = "\x3b\x6c\x29\x36\xb6\xef\x07\xa6" | ||
5962 | "\x83\x72\x07\x4f\xcf\xfa\x66\x89" | ||
5963 | "\x5f\xca\xb1\xba\xd5\x8f\x2c\x27" | ||
5964 | "\x30\xdb\x75\x09\x93\xd4\x65\xe4", | ||
5965 | .ilen = 32, | ||
5966 | .result = "\xb0\x88\x5a\x33\xaa\xe5\xc7\x1d" | ||
5967 | "\x85\x23\xc7\xc6\x2f\xf4\x1e\x3d" | ||
5968 | "\xcc\x63\x44\x25\x07\x78\x4f\x9e" | ||
5969 | "\x96\xb8\x88\xeb\xbc\x48\x1f\x06" | ||
5970 | "\x39\xaf\x39\xac\xd8\x4a\x80\x39" | ||
5971 | "\x7b\x72\x8a\xf7", | ||
5972 | .rlen = 44, | ||
5973 | }, { | ||
5974 | .key = "\xab\xd0\xe9\x33\x07\x26\xe5\x83" | ||
5975 | "\x8c\x76\x95\xd4\xb6\xdc\xf3\x46" | ||
5976 | "\xf9\x8f\xad\xe3\x02\x13\x83\x77" | ||
5977 | "\x3f\xb0\xf1\xa1\xa1\x22\x0f\x2b" | ||
5978 | "\x24\xa7\x8b", | ||
5979 | .klen = 35, | ||
5980 | .iv = "\x07\xcb\xcc\x0e\xe6\x33\xbf\xf5", | ||
5981 | .assoc = "\xd4\xdb\x30\x1d\x03\xfe\xfd\x5f" | ||
5982 | "\x87\xd4\x8c\xb6\xb6\xf1\x7a\x5d" | ||
5983 | "\xab\x90\x65\x8d\x8e\xca\x4d\x4f" | ||
5984 | "\x16\x0c\x40\x90\x4b\xc7\x36\x73", | ||
5985 | .alen = 32, | ||
5986 | .input = "\xf5\xc6\x7d\x48\xc1\xb7\xe6\x92" | ||
5987 | "\x97\x5a\xca\xc4\xa9\x6d\xf9\x3d" | ||
5988 | "\x6c\xde\xbc\xf1\x90\xea\x6a\xb2" | ||
5989 | "\x35\x86\x36\xaf\x5c\xfe\x4b\x3a", | ||
5990 | .ilen = 32, | ||
5991 | .result = "\x83\x6f\x40\x87\x72\xcf\xc1\x13" | ||
5992 | "\xef\xbb\x80\x21\x04\x6c\x58\x09" | ||
5993 | "\x07\x1b\xfc\xdf\xc0\x3f\x5b\xc7" | ||
5994 | "\xe0\x79\xa8\x6e\x71\x7c\x3f\xcf" | ||
5995 | "\x5c\xda\xb2\x33\xe5\x13\xe2\x0d" | ||
5996 | "\x74\xd1\xef\xb5\x0f\x3a\xb5\xf8", | ||
5997 | .rlen = 48, | ||
5998 | }, | ||
5999 | }; | ||
6000 | |||
6001 | static struct aead_testvec aes_ccm_rfc4309_dec_tv_template[] = { | ||
6002 | { | ||
6003 | .key = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1" | ||
6004 | "\xff\x80\x2e\x48\x7d\x82\xf8\xb9" | ||
6005 | "\xc6\xfb\x7d", | ||
6006 | .klen = 19, | ||
6007 | .iv = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8", | ||
6008 | .alen = 0, | ||
6009 | .input = "\xd5\xe8\x93\x9f\xc7\x89\x2e\x2b", | ||
6010 | .ilen = 8, | ||
6011 | .result = "\x00", | ||
6012 | .rlen = 0, | ||
6013 | .novrfy = 1, | ||
6014 | }, { | ||
6015 | .key = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1" | ||
6016 | "\xff\x80\x2e\x48\x7d\x82\xf8\xb9" | ||
6017 | "\xaf\x94\x87", | ||
6018 | .klen = 19, | ||
6019 | .iv = "\x78\x35\x82\x81\x7f\x88\x94\x68", | ||
6020 | .alen = 0, | ||
6021 | .input = "\x41\x3c\xb8\x87\x73\xcb\xf3\xf3", | ||
6022 | .ilen = 8, | ||
6023 | .result = "\x00", | ||
6024 | .rlen = 0, | ||
6025 | }, { | ||
6026 | .key = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38" | ||
6027 | "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8" | ||
6028 | "\xc6\xfb\x7d", | ||
6029 | .klen = 19, | ||
6030 | .iv = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8", | ||
6031 | .assoc = "\xf3\x94\x87\x78\x35\x82\x81\x7f" | ||
6032 | "\x88\x94\x68\xb1\x78\x6b\x2b\xd6" | ||
6033 | "\x04\x1f\x4e\xed\x78\xd5\x33\x66" | ||
6034 | "\xd8\x94\x99\x91\x81\x54\x62\x57", | ||
6035 | .alen = 32, | ||
6036 | .input = "\xf0\x7c\x29\x02\xae\x1c\x2f\x55" | ||
6037 | "\xd0\xd1\x3d\x1a\xa3\x6d\xe4\x0a" | ||
6038 | "\x86\xb0\x87\x6b\x62\x33\x8c\x34" | ||
6039 | "\xce\xab\x57\xcc\x79\x0b\xe0\x6f" | ||
6040 | "\x5c\x3e\x48\x1f\x6c\x46\xf7\x51" | ||
6041 | "\x8b\x84\x83\x2a\xc1\x05\xb8\xc5", | ||
6042 | .ilen = 48, | ||
6043 | .result = "\x50\x82\x3e\x07\xe2\x1e\xb6\xfb" | ||
6044 | "\x33\xe4\x73\xce\xd2\xfb\x95\x79" | ||
6045 | "\xe8\xb4\xb5\x77\x11\x10\x62\x6f" | ||
6046 | "\x6a\x82\xd1\x13\xec\xf5\xd0\x48", | ||
6047 | .rlen = 32, | ||
6048 | .novrfy = 1, | ||
6049 | }, { | ||
6050 | .key = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38" | ||
6051 | "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8" | ||
6052 | "\x05\xe0\xc9", | ||
6053 | .klen = 19, | ||
6054 | .iv = "\x0f\xed\x34\xea\x97\xd4\x3b\xdf", | ||
6055 | .assoc = "\x49\x5c\x50\x1f\x1d\x94\xcc\x81" | ||
6056 | "\xba\xb7\xb6\x03\xaf\xa5\xc1\xa1" | ||
6057 | "\xd8\x5c\x42\x68\xe0\x6c\xda\x89" | ||
6058 | "\x05\xac\x56\xac\x1b\x2a\xd3\x86", | ||
6059 | .alen = 32, | ||
6060 | .input = "\x39\xbe\x7d\x15\x62\x77\xf3\x3c" | ||
6061 | "\xad\x83\x52\x6d\x71\x03\x25\x1c" | ||
6062 | "\xed\x81\x3a\x9a\x16\x7d\x19\x80" | ||
6063 | "\x72\x04\x72\xd0\xf6\xff\x05\x0f" | ||
6064 | "\xb7\x14\x30\x00\x32\x9e\xa0\xa6" | ||
6065 | "\x9e\x5a\x18\xa1\xb8\xfe\xdb\xd3", | ||
6066 | .ilen = 48, | ||
6067 | .result = "\x75\x05\xbe\xc2\xd9\x1e\xde\x60" | ||
6068 | "\x47\x3d\x8c\x7d\xbd\xb5\xd9\xb7" | ||
6069 | "\xf2\xae\x61\x05\x8f\x82\x24\x3f" | ||
6070 | "\x9c\x67\x91\xe1\x38\x4f\xe4\x0c", | ||
6071 | .rlen = 32, | ||
6072 | }, { | ||
6073 | .key = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73" | ||
6074 | "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3" | ||
6075 | "\xa4\x48\x93\x39\x26\x71\x4a\xc6" | ||
6076 | "\xee\x49\x83", | ||
6077 | .klen = 27, | ||
6078 | .iv = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e", | ||
6079 | .assoc = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1" | ||
6080 | "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64" | ||
6081 | "\xa4\xf0\x13\x05\xd1\x77\x99\x67" | ||
6082 | "\x11\xc4\xc6\xdb\x00\x56\x36\x61", | ||
6083 | .alen = 32, | ||
6084 | .input = "\x71\x99\xfa\xf4\x44\x12\x68\x9b", | ||
6085 | .ilen = 8, | ||
6086 | .result = "\x00", | ||
6087 | .rlen = 0, | ||
6088 | }, { | ||
6089 | .key = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7" | ||
6090 | "\x96\xe5\xc5\x68\xaa\x95\x35\xe0" | ||
6091 | "\x29\xa0\xba\x9e\x48\x78\xd1\xba" | ||
6092 | "\xee\x49\x83", | ||
6093 | .klen = 27, | ||
6094 | .iv = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e", | ||
6095 | .assoc = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1" | ||
6096 | "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64" | ||
6097 | "\xa4\xf0\x13\x05\xd1\x77\x99\x67" | ||
6098 | "\x11\xc4\xc6\xdb\x00\x56\x36\x61", | ||
6099 | .alen = 32, | ||
6100 | .input = "\xfb\xe5\x5d\x34\xbe\xe5\xe8\xe7" | ||
6101 | "\x5a\xef\x2f\xbf\x1f\x7f\xd4\xb2" | ||
6102 | "\x66\xca\x61\x1e\x96\x7a\x61\xb3" | ||
6103 | "\x1c\x16\x45\x52\xba\x04\x9c\x9f" | ||
6104 | "\xb1\xd2\x40\xbc\x52\x7c\x6f\xb1", | ||
6105 | .ilen = 40, | ||
6106 | .result = "\x85\x34\x66\x42\xc8\x92\x0f\x36" | ||
6107 | "\x58\xe0\x6b\x91\x3c\x98\x5c\xbb" | ||
6108 | "\x0a\x85\xcc\x02\xad\x7a\x96\xe9" | ||
6109 | "\x65\x43\xa4\xc3\x0f\xdc\x55\x81", | ||
6110 | .rlen = 32, | ||
6111 | }, { | ||
6112 | .key = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7" | ||
6113 | "\x96\xe5\xc5\x68\xaa\x95\x35\xe0" | ||
6114 | "\x29\xa0\xba\x9e\x48\x78\xd1\xba" | ||
6115 | "\xd1\xfc\x57", | ||
6116 | .klen = 27, | ||
6117 | .iv = "\x9c\xfe\xb8\x9c\xad\x71\xaa\x1f", | ||
6118 | .assoc = "\x86\x67\xa5\xa9\x14\x5f\x0d\xc6" | ||
6119 | "\xff\x14\xc7\x44\xbf\x6c\x3a\xc3" | ||
6120 | "\xff\xb6\x81\xbd\xe2\xd5\x06\xc7" | ||
6121 | "\x3c\xa1\x52\x13\x03\x8a\x23\x3a", | ||
6122 | .alen = 32, | ||
6123 | .input = "\x3f\x66\xb0\x9d\xe5\x4b\x38\x00" | ||
6124 | "\xc6\x0e\x6e\xe5\xd6\x98\xa6\x37" | ||
6125 | "\x8c\x26\x33\xc6\xb2\xa2\x17\xfa" | ||
6126 | "\x64\x19\xc0\x30\xd7\xfc\x14\x6b" | ||
6127 | "\xe3\x33\xc2\x04\xb0\x37\xbe\x3f" | ||
6128 | "\xa9\xb4\x2d\x68\x03\xa3\x44\xef", | ||
6129 | .ilen = 48, | ||
6130 | .result = "\x02\x87\x4d\x28\x80\x6e\xb2\xed" | ||
6131 | "\x99\x2a\xa8\xca\x04\x25\x45\x90" | ||
6132 | "\x1d\xdd\x5a\xd9\xe4\xdb\x9c\x9c" | ||
6133 | "\x49\xe9\x01\xfe\xa7\x80\x6d\x6b", | ||
6134 | .rlen = 32, | ||
6135 | .novrfy = 1, | ||
6136 | }, { | ||
6137 | .key = "\xa4\x4b\x54\x29\x0a\xb8\x6d\x01" | ||
6138 | "\x5b\x80\x2a\xcf\x25\xc4\xb7\x5c" | ||
6139 | "\x20\x2c\xad\x30\xc2\x2b\x41\xfb" | ||
6140 | "\x0e\x85\xbc\x33\xad\x0f\x2b\xff" | ||
6141 | "\xee\x49\x83", | ||
6142 | .klen = 35, | ||
6143 | .iv = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e", | ||
6144 | .alen = 0, | ||
6145 | .input = "\x1f\xb8\x8f\xa3\xdd\x54\x00\xf2", | ||
6146 | .ilen = 8, | ||
6147 | .result = "\x00", | ||
6148 | .rlen = 0, | ||
6149 | }, { | ||
6150 | .key = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73" | ||
6151 | "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3" | ||
6152 | "\xa4\x48\x93\x39\x26\x71\x4a\xc6" | ||
6153 | "\xae\x8f\x11\x4c\xc2\x9c\x4a\xbb" | ||
6154 | "\x85\x34\x66", | ||
6155 | .klen = 35, | ||
6156 | .iv = "\x42\xc8\x92\x0f\x36\x58\xe0\x6b", | ||
6157 | .alen = 0, | ||
6158 | .input = "\x48\x01\x5e\x02\x24\x04\x66\x47" | ||
6159 | "\xa1\xea\x6f\xaf\xe8\xfc\xfb\xdd" | ||
6160 | "\xa5\xa9\x87\x8d\x84\xee\x2e\x77" | ||
6161 | "\xbb\x86\xb9\xf5\x5c\x6c\xff\xf6" | ||
6162 | "\x72\xc3\x8e\xf7\x70\xb1\xb2\x07" | ||
6163 | "\xbc\xa8\xa3\xbd\x83\x7c\x1d\x2a", | ||
6164 | .ilen = 48, | ||
6165 | .result = "\xdc\x56\xf2\x71\xb0\xb1\xa0\x6c" | ||
6166 | "\xf0\x97\x3a\xfb\x6d\xe7\x32\x99" | ||
6167 | "\x3e\xaf\x70\x5e\xb2\x4d\xea\x39" | ||
6168 | "\x89\xd4\x75\x7a\x63\xb1\xda\x93", | ||
6169 | .rlen = 32, | ||
6170 | .novrfy = 1, | ||
6171 | }, { | ||
6172 | .key = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7" | ||
6173 | "\x96\xe5\xc5\x68\xaa\x95\x35\xe0" | ||
6174 | "\x29\xa0\xba\x9e\x48\x78\xd1\xba" | ||
6175 | "\x0d\x1a\x53\x3b\xb5\xe3\xf8\x8b" | ||
6176 | "\xcf\x76\x3f", | ||
6177 | .klen = 35, | ||
6178 | .iv = "\xd9\x95\x75\x8f\x44\x89\x40\x7b", | ||
6179 | .assoc = "\x8f\x86\x6c\x4d\x1d\xc5\x39\x88" | ||
6180 | "\xc8\xf3\x5c\x52\x10\x63\x6f\x2b" | ||
6181 | "\x8a\x2a\xc5\x6f\x30\x23\x58\x7b" | ||
6182 | "\xfb\x36\x03\x11\xb4\xd9\xf2\xfe", | ||
6183 | .alen = 32, | ||
6184 | .input = "\x48\x58\xd6\xf3\xad\x63\x58\xbf" | ||
6185 | "\xae\xc7\x5e\xae\x83\x8f\x7b\xe4" | ||
6186 | "\x78\x5c\x4c\x67\x71\x89\x94\xbf" | ||
6187 | "\x47\xf1\x63\x7e\x1c\x59\xbd\xc5" | ||
6188 | "\x7f\x44\x0a\x0c\x01\x18\x07\x92" | ||
6189 | "\xe1\xd3\x51\xce\x32\x6d\x0c\x5b", | ||
6190 | .ilen = 48, | ||
6191 | .result = "\xc2\x54\xc8\xde\x78\x87\x77\x40" | ||
6192 | "\x49\x71\xe4\xb7\xe7\xcb\x76\x61" | ||
6193 | "\x0a\x41\xb9\xe9\xc0\x76\x54\xab" | ||
6194 | "\x04\x49\x3b\x19\x93\x57\x25\x5d", | ||
6195 | .rlen = 32, | ||
6196 | }, | ||
6197 | }; | ||
6198 | |||
5829 | /* Cast5 test vectors from RFC 2144 */ | 6199 | /* Cast5 test vectors from RFC 2144 */ |
5830 | #define CAST5_ENC_TEST_VECTORS 3 | 6200 | #define CAST5_ENC_TEST_VECTORS 3 |
5831 | #define CAST5_DEC_TEST_VECTORS 3 | 6201 | #define CAST5_DEC_TEST_VECTORS 3 |