diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-07 22:44:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-07 22:44:40 -0400 |
commit | 639b4ac691c6f6e48921dc576379c176f82f3250 (patch) | |
tree | 6cf521ae7d46ca8dfa139ca67dd32545de8d2a75 /crypto | |
parent | 9d2cd01b15d0782adb81e40094b67904d77b03df (diff) | |
parent | 5208ed2ca16526cdbec25abe594a3cc3aea210f4 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6 into next
Pull crypto updates from Herbert Xu:
"Here is the crypto update for 3.16:
- Added test vectors for SHA/AES-CCM/DES-CBC/3DES-CBC.
- Fixed a number of error-path memory leaks in tcrypt.
- Fixed error-path memory leak in caam.
- Removed unnecessary global mutex from mxs-dcp.
- Added ahash walk interface that can actually be asynchronous.
- Cleaned up caam error reporting.
- Allow crypto_user get operation to be used by non-root users.
- Add support for SSS module on Exynos.
- Misc fixes"
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6: (60 commits)
crypto: testmgr - add aead cbc des, des3_ede tests
crypto: testmgr - Fix DMA-API warning
crypto: cesa - tfm->__crt_alg->cra_type directly
crypto: sahara - tfm->__crt_alg->cra_name directly
crypto: padlock - tfm->__crt_alg->cra_name directly
crypto: n2 - tfm->__crt_alg->cra_name directly
crypto: dcp - tfm->__crt_alg->cra_name directly
crypto: cesa - tfm->__crt_alg->cra_name directly
crypto: ccp - tfm->__crt_alg->cra_name directly
crypto: geode - Don't use tfm->__crt_alg->cra_name directly
crypto: geode - Weed out printk() from probe()
crypto: geode - Consistently use AES_KEYSIZE_128
crypto: geode - Kill AES_IV_LENGTH
crypto: geode - Kill AES_MIN_BLOCK_SIZE
crypto: mxs-dcp - Remove global mutex
crypto: hash - Add real ahash walk interface
hwrng: n2-drv - Introduce the use of the managed version of kzalloc
crypto: caam - reinitialize keys_fit_inline for decrypt and givencrypt
crypto: s5p-sss - fix multiplatform build
hwrng: timeriomem - remove unnecessary OOM messages
...
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/ahash.c | 41 | ||||
-rw-r--r-- | crypto/crypto_user.c | 12 | ||||
-rw-r--r-- | crypto/tcrypt.c | 52 | ||||
-rw-r--r-- | crypto/testmgr.c | 181 | ||||
-rw-r--r-- | crypto/testmgr.h | 1441 |
5 files changed, 1674 insertions, 53 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c index 6e7223392e80..f2a5d8f656ff 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <crypto/internal/hash.h> | 16 | #include <crypto/internal/hash.h> |
17 | #include <crypto/scatterwalk.h> | 17 | #include <crypto/scatterwalk.h> |
18 | #include <linux/bug.h> | ||
18 | #include <linux/err.h> | 19 | #include <linux/err.h> |
19 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
20 | #include <linux/module.h> | 21 | #include <linux/module.h> |
@@ -46,7 +47,10 @@ static int hash_walk_next(struct crypto_hash_walk *walk) | |||
46 | unsigned int nbytes = min(walk->entrylen, | 47 | unsigned int nbytes = min(walk->entrylen, |
47 | ((unsigned int)(PAGE_SIZE)) - offset); | 48 | ((unsigned int)(PAGE_SIZE)) - offset); |
48 | 49 | ||
49 | walk->data = kmap_atomic(walk->pg); | 50 | if (walk->flags & CRYPTO_ALG_ASYNC) |
51 | walk->data = kmap(walk->pg); | ||
52 | else | ||
53 | walk->data = kmap_atomic(walk->pg); | ||
50 | walk->data += offset; | 54 | walk->data += offset; |
51 | 55 | ||
52 | if (offset & alignmask) { | 56 | if (offset & alignmask) { |
@@ -93,8 +97,16 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) | |||
93 | return nbytes; | 97 | return nbytes; |
94 | } | 98 | } |
95 | 99 | ||
96 | kunmap_atomic(walk->data); | 100 | if (walk->flags & CRYPTO_ALG_ASYNC) |
97 | crypto_yield(walk->flags); | 101 | kunmap(walk->pg); |
102 | else { | ||
103 | kunmap_atomic(walk->data); | ||
104 | /* | ||
105 | * The may sleep test only makes sense for sync users. | ||
106 | * Async users don't need to sleep here anyway. | ||
107 | */ | ||
108 | crypto_yield(walk->flags); | ||
109 | } | ||
98 | 110 | ||
99 | if (err) | 111 | if (err) |
100 | return err; | 112 | return err; |
@@ -124,12 +136,31 @@ int crypto_hash_walk_first(struct ahash_request *req, | |||
124 | 136 | ||
125 | walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); | 137 | walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); |
126 | walk->sg = req->src; | 138 | walk->sg = req->src; |
127 | walk->flags = req->base.flags; | 139 | walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK; |
128 | 140 | ||
129 | return hash_walk_new_entry(walk); | 141 | return hash_walk_new_entry(walk); |
130 | } | 142 | } |
131 | EXPORT_SYMBOL_GPL(crypto_hash_walk_first); | 143 | EXPORT_SYMBOL_GPL(crypto_hash_walk_first); |
132 | 144 | ||
145 | int crypto_ahash_walk_first(struct ahash_request *req, | ||
146 | struct crypto_hash_walk *walk) | ||
147 | { | ||
148 | walk->total = req->nbytes; | ||
149 | |||
150 | if (!walk->total) | ||
151 | return 0; | ||
152 | |||
153 | walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); | ||
154 | walk->sg = req->src; | ||
155 | walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK; | ||
156 | walk->flags |= CRYPTO_ALG_ASYNC; | ||
157 | |||
158 | BUILD_BUG_ON(CRYPTO_TFM_REQ_MASK & CRYPTO_ALG_ASYNC); | ||
159 | |||
160 | return hash_walk_new_entry(walk); | ||
161 | } | ||
162 | EXPORT_SYMBOL_GPL(crypto_ahash_walk_first); | ||
163 | |||
133 | int crypto_hash_walk_first_compat(struct hash_desc *hdesc, | 164 | int crypto_hash_walk_first_compat(struct hash_desc *hdesc, |
134 | struct crypto_hash_walk *walk, | 165 | struct crypto_hash_walk *walk, |
135 | struct scatterlist *sg, unsigned int len) | 166 | struct scatterlist *sg, unsigned int len) |
@@ -141,7 +172,7 @@ int crypto_hash_walk_first_compat(struct hash_desc *hdesc, | |||
141 | 172 | ||
142 | walk->alignmask = crypto_hash_alignmask(hdesc->tfm); | 173 | walk->alignmask = crypto_hash_alignmask(hdesc->tfm); |
143 | walk->sg = sg; | 174 | walk->sg = sg; |
144 | walk->flags = hdesc->flags; | 175 | walk->flags = hdesc->flags & CRYPTO_TFM_REQ_MASK; |
145 | 176 | ||
146 | return hash_walk_new_entry(walk); | 177 | return hash_walk_new_entry(walk); |
147 | } | 178 | } |
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 43665d0d0905..e2a34feec7a4 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c | |||
@@ -265,6 +265,9 @@ static int crypto_update_alg(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
265 | struct nlattr *priority = attrs[CRYPTOCFGA_PRIORITY_VAL]; | 265 | struct nlattr *priority = attrs[CRYPTOCFGA_PRIORITY_VAL]; |
266 | LIST_HEAD(list); | 266 | LIST_HEAD(list); |
267 | 267 | ||
268 | if (!netlink_capable(skb, CAP_NET_ADMIN)) | ||
269 | return -EPERM; | ||
270 | |||
268 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) | 271 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) |
269 | return -EINVAL; | 272 | return -EINVAL; |
270 | 273 | ||
@@ -295,6 +298,9 @@ static int crypto_del_alg(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
295 | struct crypto_alg *alg; | 298 | struct crypto_alg *alg; |
296 | struct crypto_user_alg *p = nlmsg_data(nlh); | 299 | struct crypto_user_alg *p = nlmsg_data(nlh); |
297 | 300 | ||
301 | if (!netlink_capable(skb, CAP_NET_ADMIN)) | ||
302 | return -EPERM; | ||
303 | |||
298 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) | 304 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) |
299 | return -EINVAL; | 305 | return -EINVAL; |
300 | 306 | ||
@@ -379,6 +385,9 @@ static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
379 | struct crypto_user_alg *p = nlmsg_data(nlh); | 385 | struct crypto_user_alg *p = nlmsg_data(nlh); |
380 | struct nlattr *priority = attrs[CRYPTOCFGA_PRIORITY_VAL]; | 386 | struct nlattr *priority = attrs[CRYPTOCFGA_PRIORITY_VAL]; |
381 | 387 | ||
388 | if (!netlink_capable(skb, CAP_NET_ADMIN)) | ||
389 | return -EPERM; | ||
390 | |||
382 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) | 391 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) |
383 | return -EINVAL; | 392 | return -EINVAL; |
384 | 393 | ||
@@ -466,9 +475,6 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
466 | type -= CRYPTO_MSG_BASE; | 475 | type -= CRYPTO_MSG_BASE; |
467 | link = &crypto_dispatch[type]; | 476 | link = &crypto_dispatch[type]; |
468 | 477 | ||
469 | if (!netlink_capable(skb, CAP_NET_ADMIN)) | ||
470 | return -EPERM; | ||
471 | |||
472 | if ((type == (CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE) && | 478 | if ((type == (CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE) && |
473 | (nlh->nlmsg_flags & NLM_F_DUMP))) { | 479 | (nlh->nlmsg_flags & NLM_F_DUMP))) { |
474 | struct crypto_alg *alg; | 480 | struct crypto_alg *alg; |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 870be7b4dc05..ba247cf30858 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -282,6 +282,11 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec, | |||
282 | unsigned int *b_size; | 282 | unsigned int *b_size; |
283 | unsigned int iv_len; | 283 | unsigned int iv_len; |
284 | 284 | ||
285 | if (aad_size >= PAGE_SIZE) { | ||
286 | pr_err("associate data length (%u) too big\n", aad_size); | ||
287 | return; | ||
288 | } | ||
289 | |||
285 | if (enc == ENCRYPT) | 290 | if (enc == ENCRYPT) |
286 | e = "encryption"; | 291 | e = "encryption"; |
287 | else | 292 | else |
@@ -308,14 +313,14 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec, | |||
308 | if (IS_ERR(tfm)) { | 313 | if (IS_ERR(tfm)) { |
309 | pr_err("alg: aead: Failed to load transform for %s: %ld\n", algo, | 314 | pr_err("alg: aead: Failed to load transform for %s: %ld\n", algo, |
310 | PTR_ERR(tfm)); | 315 | PTR_ERR(tfm)); |
311 | return; | 316 | goto out_notfm; |
312 | } | 317 | } |
313 | 318 | ||
314 | req = aead_request_alloc(tfm, GFP_KERNEL); | 319 | req = aead_request_alloc(tfm, GFP_KERNEL); |
315 | if (!req) { | 320 | if (!req) { |
316 | pr_err("alg: aead: Failed to allocate request for %s\n", | 321 | pr_err("alg: aead: Failed to allocate request for %s\n", |
317 | algo); | 322 | algo); |
318 | goto out; | 323 | goto out_noreq; |
319 | } | 324 | } |
320 | 325 | ||
321 | i = 0; | 326 | i = 0; |
@@ -323,14 +328,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec, | |||
323 | b_size = aead_sizes; | 328 | b_size = aead_sizes; |
324 | do { | 329 | do { |
325 | assoc = axbuf[0]; | 330 | assoc = axbuf[0]; |
326 | 331 | memset(assoc, 0xff, aad_size); | |
327 | if (aad_size < PAGE_SIZE) | ||
328 | memset(assoc, 0xff, aad_size); | ||
329 | else { | ||
330 | pr_err("associate data length (%u) too big\n", | ||
331 | aad_size); | ||
332 | goto out_nosg; | ||
333 | } | ||
334 | sg_init_one(&asg[0], assoc, aad_size); | 332 | sg_init_one(&asg[0], assoc, aad_size); |
335 | 333 | ||
336 | if ((*keysize + *b_size) > TVMEMSIZE * PAGE_SIZE) { | 334 | if ((*keysize + *b_size) > TVMEMSIZE * PAGE_SIZE) { |
@@ -392,7 +390,10 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec, | |||
392 | } while (*keysize); | 390 | } while (*keysize); |
393 | 391 | ||
394 | out: | 392 | out: |
393 | aead_request_free(req); | ||
394 | out_noreq: | ||
395 | crypto_free_aead(tfm); | 395 | crypto_free_aead(tfm); |
396 | out_notfm: | ||
396 | kfree(sg); | 397 | kfree(sg); |
397 | out_nosg: | 398 | out_nosg: |
398 | testmgr_free_buf(xoutbuf); | 399 | testmgr_free_buf(xoutbuf); |
@@ -1518,7 +1519,36 @@ static int do_test(int m) | |||
1518 | case 157: | 1519 | case 157: |
1519 | ret += tcrypt_test("authenc(hmac(sha1),ecb(cipher_null))"); | 1520 | ret += tcrypt_test("authenc(hmac(sha1),ecb(cipher_null))"); |
1520 | break; | 1521 | break; |
1521 | 1522 | case 181: | |
1523 | ret += tcrypt_test("authenc(hmac(sha1),cbc(des))"); | ||
1524 | break; | ||
1525 | case 182: | ||
1526 | ret += tcrypt_test("authenc(hmac(sha1),cbc(des3_ede))"); | ||
1527 | break; | ||
1528 | case 183: | ||
1529 | ret += tcrypt_test("authenc(hmac(sha224),cbc(des))"); | ||
1530 | break; | ||
1531 | case 184: | ||
1532 | ret += tcrypt_test("authenc(hmac(sha224),cbc(des3_ede))"); | ||
1533 | break; | ||
1534 | case 185: | ||
1535 | ret += tcrypt_test("authenc(hmac(sha256),cbc(des))"); | ||
1536 | break; | ||
1537 | case 186: | ||
1538 | ret += tcrypt_test("authenc(hmac(sha256),cbc(des3_ede))"); | ||
1539 | break; | ||
1540 | case 187: | ||
1541 | ret += tcrypt_test("authenc(hmac(sha384),cbc(des))"); | ||
1542 | break; | ||
1543 | case 188: | ||
1544 | ret += tcrypt_test("authenc(hmac(sha384),cbc(des3_ede))"); | ||
1545 | break; | ||
1546 | case 189: | ||
1547 | ret += tcrypt_test("authenc(hmac(sha512),cbc(des))"); | ||
1548 | break; | ||
1549 | case 190: | ||
1550 | ret += tcrypt_test("authenc(hmac(sha512),cbc(des3_ede))"); | ||
1551 | break; | ||
1522 | case 200: | 1552 | case 200: |
1523 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, | 1553 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, |
1524 | speed_template_16_24_32); | 1554 | speed_template_16_24_32); |
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index dc3cf3535ef0..498649ac1953 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -414,16 +414,18 @@ static int __test_aead(struct crypto_aead *tfm, int enc, | |||
414 | void *input; | 414 | void *input; |
415 | void *output; | 415 | void *output; |
416 | void *assoc; | 416 | void *assoc; |
417 | char iv[MAX_IVLEN]; | 417 | char *iv; |
418 | char *xbuf[XBUFSIZE]; | 418 | char *xbuf[XBUFSIZE]; |
419 | char *xoutbuf[XBUFSIZE]; | 419 | char *xoutbuf[XBUFSIZE]; |
420 | char *axbuf[XBUFSIZE]; | 420 | char *axbuf[XBUFSIZE]; |
421 | 421 | ||
422 | iv = kzalloc(MAX_IVLEN, GFP_KERNEL); | ||
423 | if (!iv) | ||
424 | return ret; | ||
422 | if (testmgr_alloc_buf(xbuf)) | 425 | if (testmgr_alloc_buf(xbuf)) |
423 | goto out_noxbuf; | 426 | goto out_noxbuf; |
424 | if (testmgr_alloc_buf(axbuf)) | 427 | if (testmgr_alloc_buf(axbuf)) |
425 | goto out_noaxbuf; | 428 | goto out_noaxbuf; |
426 | |||
427 | if (diff_dst && testmgr_alloc_buf(xoutbuf)) | 429 | if (diff_dst && testmgr_alloc_buf(xoutbuf)) |
428 | goto out_nooutbuf; | 430 | goto out_nooutbuf; |
429 | 431 | ||
@@ -767,6 +769,7 @@ out_nooutbuf: | |||
767 | out_noaxbuf: | 769 | out_noaxbuf: |
768 | testmgr_free_buf(xbuf); | 770 | testmgr_free_buf(xbuf); |
769 | out_noxbuf: | 771 | out_noxbuf: |
772 | kfree(iv); | ||
770 | return ret; | 773 | return ret; |
771 | } | 774 | } |
772 | 775 | ||
@@ -1831,8 +1834,38 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1831 | .suite = { | 1834 | .suite = { |
1832 | .aead = { | 1835 | .aead = { |
1833 | .enc = { | 1836 | .enc = { |
1834 | .vecs = hmac_sha1_aes_cbc_enc_tv_template, | 1837 | .vecs = |
1835 | .count = HMAC_SHA1_AES_CBC_ENC_TEST_VECTORS | 1838 | hmac_sha1_aes_cbc_enc_tv_temp, |
1839 | .count = | ||
1840 | HMAC_SHA1_AES_CBC_ENC_TEST_VEC | ||
1841 | } | ||
1842 | } | ||
1843 | } | ||
1844 | }, { | ||
1845 | .alg = "authenc(hmac(sha1),cbc(des))", | ||
1846 | .test = alg_test_aead, | ||
1847 | .fips_allowed = 1, | ||
1848 | .suite = { | ||
1849 | .aead = { | ||
1850 | .enc = { | ||
1851 | .vecs = | ||
1852 | hmac_sha1_des_cbc_enc_tv_temp, | ||
1853 | .count = | ||
1854 | HMAC_SHA1_DES_CBC_ENC_TEST_VEC | ||
1855 | } | ||
1856 | } | ||
1857 | } | ||
1858 | }, { | ||
1859 | .alg = "authenc(hmac(sha1),cbc(des3_ede))", | ||
1860 | .test = alg_test_aead, | ||
1861 | .fips_allowed = 1, | ||
1862 | .suite = { | ||
1863 | .aead = { | ||
1864 | .enc = { | ||
1865 | .vecs = | ||
1866 | hmac_sha1_des3_ede_cbc_enc_tv_temp, | ||
1867 | .count = | ||
1868 | HMAC_SHA1_DES3_EDE_CBC_ENC_TEST_VEC | ||
1836 | } | 1869 | } |
1837 | } | 1870 | } |
1838 | } | 1871 | } |
@@ -1843,12 +1876,44 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1843 | .suite = { | 1876 | .suite = { |
1844 | .aead = { | 1877 | .aead = { |
1845 | .enc = { | 1878 | .enc = { |
1846 | .vecs = hmac_sha1_ecb_cipher_null_enc_tv_template, | 1879 | .vecs = |
1847 | .count = HMAC_SHA1_ECB_CIPHER_NULL_ENC_TEST_VECTORS | 1880 | hmac_sha1_ecb_cipher_null_enc_tv_temp, |
1881 | .count = | ||
1882 | HMAC_SHA1_ECB_CIPHER_NULL_ENC_TEST_VEC | ||
1848 | }, | 1883 | }, |
1849 | .dec = { | 1884 | .dec = { |
1850 | .vecs = hmac_sha1_ecb_cipher_null_dec_tv_template, | 1885 | .vecs = |
1851 | .count = HMAC_SHA1_ECB_CIPHER_NULL_DEC_TEST_VECTORS | 1886 | hmac_sha1_ecb_cipher_null_dec_tv_temp, |
1887 | .count = | ||
1888 | HMAC_SHA1_ECB_CIPHER_NULL_DEC_TEST_VEC | ||
1889 | } | ||
1890 | } | ||
1891 | } | ||
1892 | }, { | ||
1893 | .alg = "authenc(hmac(sha224),cbc(des))", | ||
1894 | .test = alg_test_aead, | ||
1895 | .fips_allowed = 1, | ||
1896 | .suite = { | ||
1897 | .aead = { | ||
1898 | .enc = { | ||
1899 | .vecs = | ||
1900 | hmac_sha224_des_cbc_enc_tv_temp, | ||
1901 | .count = | ||
1902 | HMAC_SHA224_DES_CBC_ENC_TEST_VEC | ||
1903 | } | ||
1904 | } | ||
1905 | } | ||
1906 | }, { | ||
1907 | .alg = "authenc(hmac(sha224),cbc(des3_ede))", | ||
1908 | .test = alg_test_aead, | ||
1909 | .fips_allowed = 1, | ||
1910 | .suite = { | ||
1911 | .aead = { | ||
1912 | .enc = { | ||
1913 | .vecs = | ||
1914 | hmac_sha224_des3_ede_cbc_enc_tv_temp, | ||
1915 | .count = | ||
1916 | HMAC_SHA224_DES3_EDE_CBC_ENC_TEST_VEC | ||
1852 | } | 1917 | } |
1853 | } | 1918 | } |
1854 | } | 1919 | } |
@@ -1859,8 +1924,66 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1859 | .suite = { | 1924 | .suite = { |
1860 | .aead = { | 1925 | .aead = { |
1861 | .enc = { | 1926 | .enc = { |
1862 | .vecs = hmac_sha256_aes_cbc_enc_tv_template, | 1927 | .vecs = |
1863 | .count = HMAC_SHA256_AES_CBC_ENC_TEST_VECTORS | 1928 | hmac_sha256_aes_cbc_enc_tv_temp, |
1929 | .count = | ||
1930 | HMAC_SHA256_AES_CBC_ENC_TEST_VEC | ||
1931 | } | ||
1932 | } | ||
1933 | } | ||
1934 | }, { | ||
1935 | .alg = "authenc(hmac(sha256),cbc(des))", | ||
1936 | .test = alg_test_aead, | ||
1937 | .fips_allowed = 1, | ||
1938 | .suite = { | ||
1939 | .aead = { | ||
1940 | .enc = { | ||
1941 | .vecs = | ||
1942 | hmac_sha256_des_cbc_enc_tv_temp, | ||
1943 | .count = | ||
1944 | HMAC_SHA256_DES_CBC_ENC_TEST_VEC | ||
1945 | } | ||
1946 | } | ||
1947 | } | ||
1948 | }, { | ||
1949 | .alg = "authenc(hmac(sha256),cbc(des3_ede))", | ||
1950 | .test = alg_test_aead, | ||
1951 | .fips_allowed = 1, | ||
1952 | .suite = { | ||
1953 | .aead = { | ||
1954 | .enc = { | ||
1955 | .vecs = | ||
1956 | hmac_sha256_des3_ede_cbc_enc_tv_temp, | ||
1957 | .count = | ||
1958 | HMAC_SHA256_DES3_EDE_CBC_ENC_TEST_VEC | ||
1959 | } | ||
1960 | } | ||
1961 | } | ||
1962 | }, { | ||
1963 | .alg = "authenc(hmac(sha384),cbc(des))", | ||
1964 | .test = alg_test_aead, | ||
1965 | .fips_allowed = 1, | ||
1966 | .suite = { | ||
1967 | .aead = { | ||
1968 | .enc = { | ||
1969 | .vecs = | ||
1970 | hmac_sha384_des_cbc_enc_tv_temp, | ||
1971 | .count = | ||
1972 | HMAC_SHA384_DES_CBC_ENC_TEST_VEC | ||
1973 | } | ||
1974 | } | ||
1975 | } | ||
1976 | }, { | ||
1977 | .alg = "authenc(hmac(sha384),cbc(des3_ede))", | ||
1978 | .test = alg_test_aead, | ||
1979 | .fips_allowed = 1, | ||
1980 | .suite = { | ||
1981 | .aead = { | ||
1982 | .enc = { | ||
1983 | .vecs = | ||
1984 | hmac_sha384_des3_ede_cbc_enc_tv_temp, | ||
1985 | .count = | ||
1986 | HMAC_SHA384_DES3_EDE_CBC_ENC_TEST_VEC | ||
1864 | } | 1987 | } |
1865 | } | 1988 | } |
1866 | } | 1989 | } |
@@ -1871,8 +1994,38 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1871 | .suite = { | 1994 | .suite = { |
1872 | .aead = { | 1995 | .aead = { |
1873 | .enc = { | 1996 | .enc = { |
1874 | .vecs = hmac_sha512_aes_cbc_enc_tv_template, | 1997 | .vecs = |
1875 | .count = HMAC_SHA512_AES_CBC_ENC_TEST_VECTORS | 1998 | hmac_sha512_aes_cbc_enc_tv_temp, |
1999 | .count = | ||
2000 | HMAC_SHA512_AES_CBC_ENC_TEST_VEC | ||
2001 | } | ||
2002 | } | ||
2003 | } | ||
2004 | }, { | ||
2005 | .alg = "authenc(hmac(sha512),cbc(des))", | ||
2006 | .test = alg_test_aead, | ||
2007 | .fips_allowed = 1, | ||
2008 | .suite = { | ||
2009 | .aead = { | ||
2010 | .enc = { | ||
2011 | .vecs = | ||
2012 | hmac_sha512_des_cbc_enc_tv_temp, | ||
2013 | .count = | ||
2014 | HMAC_SHA512_DES_CBC_ENC_TEST_VEC | ||
2015 | } | ||
2016 | } | ||
2017 | } | ||
2018 | }, { | ||
2019 | .alg = "authenc(hmac(sha512),cbc(des3_ede))", | ||
2020 | .test = alg_test_aead, | ||
2021 | .fips_allowed = 1, | ||
2022 | .suite = { | ||
2023 | .aead = { | ||
2024 | .enc = { | ||
2025 | .vecs = | ||
2026 | hmac_sha512_des3_ede_cbc_enc_tv_temp, | ||
2027 | .count = | ||
2028 | HMAC_SHA512_DES3_EDE_CBC_ENC_TEST_VEC | ||
1876 | } | 2029 | } |
1877 | } | 2030 | } |
1878 | } | 2031 | } |
@@ -3273,8 +3426,8 @@ test_done: | |||
3273 | panic("%s: %s alg self test failed in fips mode!\n", driver, alg); | 3426 | panic("%s: %s alg self test failed in fips mode!\n", driver, alg); |
3274 | 3427 | ||
3275 | if (fips_enabled && !rc) | 3428 | if (fips_enabled && !rc) |
3276 | printk(KERN_INFO "alg: self-tests for %s (%s) passed\n", | 3429 | pr_info(KERN_INFO "alg: self-tests for %s (%s) passed\n", |
3277 | driver, alg); | 3430 | driver, alg); |
3278 | 3431 | ||
3279 | return rc; | 3432 | return rc; |
3280 | 3433 | ||
diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 3db83dbba1d9..69d0dd8ef27e 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h | |||
@@ -487,10 +487,15 @@ static struct hash_testvec crct10dif_tv_template[] = { | |||
487 | * SHA1 test vectors from from FIPS PUB 180-1 | 487 | * SHA1 test vectors from from FIPS PUB 180-1 |
488 | * Long vector from CAVS 5.0 | 488 | * Long vector from CAVS 5.0 |
489 | */ | 489 | */ |
490 | #define SHA1_TEST_VECTORS 3 | 490 | #define SHA1_TEST_VECTORS 6 |
491 | 491 | ||
492 | static struct hash_testvec sha1_tv_template[] = { | 492 | static struct hash_testvec sha1_tv_template[] = { |
493 | { | 493 | { |
494 | .plaintext = "", | ||
495 | .psize = 0, | ||
496 | .digest = "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55" | ||
497 | "\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09", | ||
498 | }, { | ||
494 | .plaintext = "abc", | 499 | .plaintext = "abc", |
495 | .psize = 3, | 500 | .psize = 3, |
496 | .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e" | 501 | .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e" |
@@ -529,6 +534,144 @@ static struct hash_testvec sha1_tv_template[] = { | |||
529 | "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17", | 534 | "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17", |
530 | .np = 4, | 535 | .np = 4, |
531 | .tap = { 63, 64, 31, 5 } | 536 | .tap = { 63, 64, 31, 5 } |
537 | }, { | ||
538 | .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-", | ||
539 | .psize = 64, | ||
540 | .digest = "\xc8\x71\xf6\x9a\x63\xcc\xa9\x84\x84\x82" | ||
541 | "\x64\xe7\x79\x95\x5d\xd7\x19\x41\x7c\x91", | ||
542 | }, { | ||
543 | .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3" | ||
544 | "\x7a\x11\x85\x1c\xb3\x27\xbe\x55" | ||
545 | "\xec\x60\xf7\x8e\x02\x99\x30\xc7" | ||
546 | "\x3b\xd2\x69\x00\x74\x0b\xa2\x16" | ||
547 | "\xad\x44\xdb\x4f\xe6\x7d\x14\x88" | ||
548 | "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa" | ||
549 | "\x91\x05\x9c\x33\xca\x3e\xd5\x6c" | ||
550 | "\x03\x77\x0e\xa5\x19\xb0\x47\xde" | ||
551 | "\x52\xe9\x80\x17\x8b\x22\xb9\x2d" | ||
552 | "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f" | ||
553 | "\x36\xcd\x41\xd8\x6f\x06\x7a\x11" | ||
554 | "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83" | ||
555 | "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5" | ||
556 | "\x69\x00\x97\x0b\xa2\x39\xd0\x44" | ||
557 | "\xdb\x72\x09\x7d\x14\xab\x1f\xb6" | ||
558 | "\x4d\xe4\x58\xef\x86\x1d\x91\x28" | ||
559 | "\xbf\x33\xca\x61\xf8\x6c\x03\x9a" | ||
560 | "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c" | ||
561 | "\x80\x17\xae\x22\xb9\x50\xe7\x5b" | ||
562 | "\xf2\x89\x20\x94\x2b\xc2\x36\xcd" | ||
563 | "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f" | ||
564 | "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1" | ||
565 | "\x25\xbc\x53\xea\x5e\xf5\x8c\x00" | ||
566 | "\x97\x2e\xc5\x39\xd0\x67\xfe\x72" | ||
567 | "\x09\xa0\x14\xab\x42\xd9\x4d\xe4" | ||
568 | "\x7b\x12\x86\x1d\xb4\x28\xbf\x56" | ||
569 | "\xed\x61\xf8\x8f\x03\x9a\x31\xc8" | ||
570 | "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17" | ||
571 | "\xae\x45\xdc\x50\xe7\x7e\x15\x89" | ||
572 | "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb" | ||
573 | "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d" | ||
574 | "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf" | ||
575 | "\x53\xea\x81\x18\x8c\x23\xba\x2e" | ||
576 | "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0" | ||
577 | "\x37\xce\x42\xd9\x70\x07\x7b\x12" | ||
578 | "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84" | ||
579 | "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6" | ||
580 | "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45" | ||
581 | "\xdc\x73\x0a\x7e\x15\xac\x20\xb7" | ||
582 | "\x4e\xe5\x59\xf0\x87\x1e\x92\x29" | ||
583 | "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b" | ||
584 | "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d" | ||
585 | "\x81\x18\xaf\x23\xba\x51\xe8\x5c" | ||
586 | "\xf3\x8a\x21\x95\x2c\xc3\x37\xce" | ||
587 | "\x65\xfc\x70\x07\x9e\x12\xa9\x40" | ||
588 | "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2" | ||
589 | "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01" | ||
590 | "\x98\x2f\xc6\x3a\xd1\x68\xff\x73" | ||
591 | "\x0a\xa1\x15\xac\x43\xda\x4e\xe5" | ||
592 | "\x7c\x13\x87\x1e\xb5\x29\xc0\x57" | ||
593 | "\xee\x62\xf9\x90\x04\x9b\x32\xc9" | ||
594 | "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18" | ||
595 | "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a" | ||
596 | "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc" | ||
597 | "\x93\x07\x9e\x35\xcc\x40\xd7\x6e" | ||
598 | "\x05\x79\x10\xa7\x1b\xb2\x49\xe0" | ||
599 | "\x54\xeb\x82\x19\x8d\x24\xbb\x2f" | ||
600 | "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1" | ||
601 | "\x38\xcf\x43\xda\x71\x08\x7c\x13" | ||
602 | "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85" | ||
603 | "\x1c\x90\x27\xbe\x32\xc9\x60\xf7" | ||
604 | "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46" | ||
605 | "\xdd\x74\x0b\x7f\x16\xad\x21\xb8" | ||
606 | "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a" | ||
607 | "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c" | ||
608 | "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e" | ||
609 | "\x82\x19\xb0\x24\xbb\x52\xe9\x5d" | ||
610 | "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf" | ||
611 | "\x66\xfd\x71\x08\x9f\x13\xaa\x41" | ||
612 | "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3" | ||
613 | "\x27\xbe\x55\xec\x60\xf7\x8e\x02" | ||
614 | "\x99\x30\xc7\x3b\xd2\x69\x00\x74" | ||
615 | "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6" | ||
616 | "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58" | ||
617 | "\xef\x63\xfa\x91\x05\x9c\x33\xca" | ||
618 | "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19" | ||
619 | "\xb0\x47\xde\x52\xe9\x80\x17\x8b" | ||
620 | "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd" | ||
621 | "\x94\x08\x9f\x36\xcd\x41\xd8\x6f" | ||
622 | "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1" | ||
623 | "\x55\xec\x83\x1a\x8e\x25\xbc\x30" | ||
624 | "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2" | ||
625 | "\x39\xd0\x44\xdb\x72\x09\x7d\x14" | ||
626 | "\xab\x1f\xb6\x4d\xe4\x58\xef\x86" | ||
627 | "\x1d\x91\x28\xbf\x33\xca\x61\xf8" | ||
628 | "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47" | ||
629 | "\xde\x75\x0c\x80\x17\xae\x22\xb9" | ||
630 | "\x50\xe7\x5b\xf2\x89\x20\x94\x2b" | ||
631 | "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d" | ||
632 | "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f" | ||
633 | "\x83\x1a\xb1\x25\xbc\x53\xea\x5e" | ||
634 | "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0" | ||
635 | "\x67\xfe\x72\x09\xa0\x14\xab\x42" | ||
636 | "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4" | ||
637 | "\x28\xbf\x56\xed\x61\xf8\x8f\x03" | ||
638 | "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75" | ||
639 | "\x0c\xa3\x17\xae\x45\xdc\x50\xe7" | ||
640 | "\x7e\x15\x89\x20\xb7\x2b\xc2\x59" | ||
641 | "\xf0\x64\xfb\x92\x06\x9d\x34\xcb" | ||
642 | "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a" | ||
643 | "\xb1\x48\xdf\x53\xea\x81\x18\x8c" | ||
644 | "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe" | ||
645 | "\x95\x09\xa0\x37\xce\x42\xd9\x70" | ||
646 | "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2" | ||
647 | "\x56\xed\x84\x1b\x8f\x26\xbd\x31" | ||
648 | "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3" | ||
649 | "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15" | ||
650 | "\xac\x20\xb7\x4e\xe5\x59\xf0\x87" | ||
651 | "\x1e\x92\x29\xc0\x34\xcb\x62\xf9" | ||
652 | "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48" | ||
653 | "\xdf\x76\x0d\x81\x18\xaf\x23\xba" | ||
654 | "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c" | ||
655 | "\xc3\x37\xce\x65\xfc\x70\x07\x9e" | ||
656 | "\x12\xa9\x40\xd7\x4b\xe2\x79\x10" | ||
657 | "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f" | ||
658 | "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1" | ||
659 | "\x68\xff\x73\x0a\xa1\x15\xac\x43" | ||
660 | "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5" | ||
661 | "\x29\xc0\x57\xee\x62\xf9\x90\x04" | ||
662 | "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76" | ||
663 | "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8" | ||
664 | "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a" | ||
665 | "\xf1\x65\xfc\x93\x07\x9e\x35\xcc" | ||
666 | "\x40\xd7\x6e\x05\x79\x10\xa7\x1b" | ||
667 | "\xb2\x49\xe0\x54\xeb\x82\x19\x8d" | ||
668 | "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff" | ||
669 | "\x96\x0a\xa1\x38\xcf\x43\xda\x71" | ||
670 | "\x08\x7c\x13\xaa\x1e\xb5\x4c", | ||
671 | .psize = 1023, | ||
672 | .digest = "\xb8\xe3\x54\xed\xc5\xfc\xef\xa4" | ||
673 | "\x55\x73\x4a\x81\x99\xe4\x47\x2a" | ||
674 | "\x30\xd6\xc9\x85", | ||
532 | } | 675 | } |
533 | }; | 676 | }; |
534 | 677 | ||
@@ -536,10 +679,17 @@ static struct hash_testvec sha1_tv_template[] = { | |||
536 | /* | 679 | /* |
537 | * SHA224 test vectors from from FIPS PUB 180-2 | 680 | * SHA224 test vectors from from FIPS PUB 180-2 |
538 | */ | 681 | */ |
539 | #define SHA224_TEST_VECTORS 2 | 682 | #define SHA224_TEST_VECTORS 5 |
540 | 683 | ||
541 | static struct hash_testvec sha224_tv_template[] = { | 684 | static struct hash_testvec sha224_tv_template[] = { |
542 | { | 685 | { |
686 | .plaintext = "", | ||
687 | .psize = 0, | ||
688 | .digest = "\xd1\x4a\x02\x8c\x2a\x3a\x2b\xc9" | ||
689 | "\x47\x61\x02\xbb\x28\x82\x34\xc4" | ||
690 | "\x15\xa2\xb0\x1f\x82\x8e\xa6\x2a" | ||
691 | "\xc5\xb3\xe4\x2f", | ||
692 | }, { | ||
543 | .plaintext = "abc", | 693 | .plaintext = "abc", |
544 | .psize = 3, | 694 | .psize = 3, |
545 | .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22" | 695 | .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22" |
@@ -556,16 +706,164 @@ static struct hash_testvec sha224_tv_template[] = { | |||
556 | "\x52\x52\x25\x25", | 706 | "\x52\x52\x25\x25", |
557 | .np = 2, | 707 | .np = 2, |
558 | .tap = { 28, 28 } | 708 | .tap = { 28, 28 } |
709 | }, { | ||
710 | .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-", | ||
711 | .psize = 64, | ||
712 | .digest = "\xc4\xdb\x2b\x3a\x58\xc3\x99\x01" | ||
713 | "\x42\xfd\x10\x92\xaa\x4e\x04\x08" | ||
714 | "\x58\xbb\xbb\xe8\xf8\x14\xa7\x0c" | ||
715 | "\xef\x3b\xcb\x0e", | ||
716 | }, { | ||
717 | .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3" | ||
718 | "\x7a\x11\x85\x1c\xb3\x27\xbe\x55" | ||
719 | "\xec\x60\xf7\x8e\x02\x99\x30\xc7" | ||
720 | "\x3b\xd2\x69\x00\x74\x0b\xa2\x16" | ||
721 | "\xad\x44\xdb\x4f\xe6\x7d\x14\x88" | ||
722 | "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa" | ||
723 | "\x91\x05\x9c\x33\xca\x3e\xd5\x6c" | ||
724 | "\x03\x77\x0e\xa5\x19\xb0\x47\xde" | ||
725 | "\x52\xe9\x80\x17\x8b\x22\xb9\x2d" | ||
726 | "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f" | ||
727 | "\x36\xcd\x41\xd8\x6f\x06\x7a\x11" | ||
728 | "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83" | ||
729 | "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5" | ||
730 | "\x69\x00\x97\x0b\xa2\x39\xd0\x44" | ||
731 | "\xdb\x72\x09\x7d\x14\xab\x1f\xb6" | ||
732 | "\x4d\xe4\x58\xef\x86\x1d\x91\x28" | ||
733 | "\xbf\x33\xca\x61\xf8\x6c\x03\x9a" | ||
734 | "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c" | ||
735 | "\x80\x17\xae\x22\xb9\x50\xe7\x5b" | ||
736 | "\xf2\x89\x20\x94\x2b\xc2\x36\xcd" | ||
737 | "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f" | ||
738 | "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1" | ||
739 | "\x25\xbc\x53\xea\x5e\xf5\x8c\x00" | ||
740 | "\x97\x2e\xc5\x39\xd0\x67\xfe\x72" | ||
741 | "\x09\xa0\x14\xab\x42\xd9\x4d\xe4" | ||
742 | "\x7b\x12\x86\x1d\xb4\x28\xbf\x56" | ||
743 | "\xed\x61\xf8\x8f\x03\x9a\x31\xc8" | ||
744 | "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17" | ||
745 | "\xae\x45\xdc\x50\xe7\x7e\x15\x89" | ||
746 | "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb" | ||
747 | "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d" | ||
748 | "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf" | ||
749 | "\x53\xea\x81\x18\x8c\x23\xba\x2e" | ||
750 | "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0" | ||
751 | "\x37\xce\x42\xd9\x70\x07\x7b\x12" | ||
752 | "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84" | ||
753 | "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6" | ||
754 | "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45" | ||
755 | "\xdc\x73\x0a\x7e\x15\xac\x20\xb7" | ||
756 | "\x4e\xe5\x59\xf0\x87\x1e\x92\x29" | ||
757 | "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b" | ||
758 | "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d" | ||
759 | "\x81\x18\xaf\x23\xba\x51\xe8\x5c" | ||
760 | "\xf3\x8a\x21\x95\x2c\xc3\x37\xce" | ||
761 | "\x65\xfc\x70\x07\x9e\x12\xa9\x40" | ||
762 | "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2" | ||
763 | "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01" | ||
764 | "\x98\x2f\xc6\x3a\xd1\x68\xff\x73" | ||
765 | "\x0a\xa1\x15\xac\x43\xda\x4e\xe5" | ||
766 | "\x7c\x13\x87\x1e\xb5\x29\xc0\x57" | ||
767 | "\xee\x62\xf9\x90\x04\x9b\x32\xc9" | ||
768 | "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18" | ||
769 | "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a" | ||
770 | "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc" | ||
771 | "\x93\x07\x9e\x35\xcc\x40\xd7\x6e" | ||
772 | "\x05\x79\x10\xa7\x1b\xb2\x49\xe0" | ||
773 | "\x54\xeb\x82\x19\x8d\x24\xbb\x2f" | ||
774 | "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1" | ||
775 | "\x38\xcf\x43\xda\x71\x08\x7c\x13" | ||
776 | "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85" | ||
777 | "\x1c\x90\x27\xbe\x32\xc9\x60\xf7" | ||
778 | "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46" | ||
779 | "\xdd\x74\x0b\x7f\x16\xad\x21\xb8" | ||
780 | "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a" | ||
781 | "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c" | ||
782 | "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e" | ||
783 | "\x82\x19\xb0\x24\xbb\x52\xe9\x5d" | ||
784 | "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf" | ||
785 | "\x66\xfd\x71\x08\x9f\x13\xaa\x41" | ||
786 | "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3" | ||
787 | "\x27\xbe\x55\xec\x60\xf7\x8e\x02" | ||
788 | "\x99\x30\xc7\x3b\xd2\x69\x00\x74" | ||
789 | "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6" | ||
790 | "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58" | ||
791 | "\xef\x63\xfa\x91\x05\x9c\x33\xca" | ||
792 | "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19" | ||
793 | "\xb0\x47\xde\x52\xe9\x80\x17\x8b" | ||
794 | "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd" | ||
795 | "\x94\x08\x9f\x36\xcd\x41\xd8\x6f" | ||
796 | "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1" | ||
797 | "\x55\xec\x83\x1a\x8e\x25\xbc\x30" | ||
798 | "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2" | ||
799 | "\x39\xd0\x44\xdb\x72\x09\x7d\x14" | ||
800 | "\xab\x1f\xb6\x4d\xe4\x58\xef\x86" | ||
801 | "\x1d\x91\x28\xbf\x33\xca\x61\xf8" | ||
802 | "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47" | ||
803 | "\xde\x75\x0c\x80\x17\xae\x22\xb9" | ||
804 | "\x50\xe7\x5b\xf2\x89\x20\x94\x2b" | ||
805 | "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d" | ||
806 | "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f" | ||
807 | "\x83\x1a\xb1\x25\xbc\x53\xea\x5e" | ||
808 | "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0" | ||
809 | "\x67\xfe\x72\x09\xa0\x14\xab\x42" | ||
810 | "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4" | ||
811 | "\x28\xbf\x56\xed\x61\xf8\x8f\x03" | ||
812 | "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75" | ||
813 | "\x0c\xa3\x17\xae\x45\xdc\x50\xe7" | ||
814 | "\x7e\x15\x89\x20\xb7\x2b\xc2\x59" | ||
815 | "\xf0\x64\xfb\x92\x06\x9d\x34\xcb" | ||
816 | "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a" | ||
817 | "\xb1\x48\xdf\x53\xea\x81\x18\x8c" | ||
818 | "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe" | ||
819 | "\x95\x09\xa0\x37\xce\x42\xd9\x70" | ||
820 | "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2" | ||
821 | "\x56\xed\x84\x1b\x8f\x26\xbd\x31" | ||
822 | "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3" | ||
823 | "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15" | ||
824 | "\xac\x20\xb7\x4e\xe5\x59\xf0\x87" | ||
825 | "\x1e\x92\x29\xc0\x34\xcb\x62\xf9" | ||
826 | "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48" | ||
827 | "\xdf\x76\x0d\x81\x18\xaf\x23\xba" | ||
828 | "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c" | ||
829 | "\xc3\x37\xce\x65\xfc\x70\x07\x9e" | ||
830 | "\x12\xa9\x40\xd7\x4b\xe2\x79\x10" | ||
831 | "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f" | ||
832 | "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1" | ||
833 | "\x68\xff\x73\x0a\xa1\x15\xac\x43" | ||
834 | "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5" | ||
835 | "\x29\xc0\x57\xee\x62\xf9\x90\x04" | ||
836 | "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76" | ||
837 | "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8" | ||
838 | "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a" | ||
839 | "\xf1\x65\xfc\x93\x07\x9e\x35\xcc" | ||
840 | "\x40\xd7\x6e\x05\x79\x10\xa7\x1b" | ||
841 | "\xb2\x49\xe0\x54\xeb\x82\x19\x8d" | ||
842 | "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff" | ||
843 | "\x96\x0a\xa1\x38\xcf\x43\xda\x71" | ||
844 | "\x08\x7c\x13\xaa\x1e\xb5\x4c", | ||
845 | .psize = 1023, | ||
846 | .digest = "\x98\x43\x07\x63\x75\xe0\xa7\x1c" | ||
847 | "\x78\xb1\x8b\xfd\x04\xf5\x2d\x91" | ||
848 | "\x20\x48\xa4\x28\xff\x55\xb1\xd3" | ||
849 | "\xe6\xf9\x4f\xcc", | ||
559 | } | 850 | } |
560 | }; | 851 | }; |
561 | 852 | ||
562 | /* | 853 | /* |
563 | * SHA256 test vectors from from NIST | 854 | * SHA256 test vectors from from NIST |
564 | */ | 855 | */ |
565 | #define SHA256_TEST_VECTORS 2 | 856 | #define SHA256_TEST_VECTORS 5 |
566 | 857 | ||
567 | static struct hash_testvec sha256_tv_template[] = { | 858 | static struct hash_testvec sha256_tv_template[] = { |
568 | { | 859 | { |
860 | .plaintext = "", | ||
861 | .psize = 0, | ||
862 | .digest = "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14" | ||
863 | "\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24" | ||
864 | "\x27\xae\x41\xe4\x64\x9b\x93\x4c" | ||
865 | "\xa4\x95\x99\x1b\x78\x52\xb8\x55", | ||
866 | }, { | ||
569 | .plaintext = "abc", | 867 | .plaintext = "abc", |
570 | .psize = 3, | 868 | .psize = 3, |
571 | .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea" | 869 | .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea" |
@@ -581,16 +879,166 @@ static struct hash_testvec sha256_tv_template[] = { | |||
581 | "\xf6\xec\xed\xd4\x19\xdb\x06\xc1", | 879 | "\xf6\xec\xed\xd4\x19\xdb\x06\xc1", |
582 | .np = 2, | 880 | .np = 2, |
583 | .tap = { 28, 28 } | 881 | .tap = { 28, 28 } |
584 | }, | 882 | }, { |
883 | .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-", | ||
884 | .psize = 64, | ||
885 | .digest = "\xb5\xfe\xad\x56\x7d\xff\xcb\xa4" | ||
886 | "\x2c\x32\x29\x32\x19\xbb\xfb\xfa" | ||
887 | "\xd6\xff\x94\xa3\x72\x91\x85\x66" | ||
888 | "\x3b\xa7\x87\x77\x58\xa3\x40\x3a", | ||
889 | }, { | ||
890 | .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3" | ||
891 | "\x7a\x11\x85\x1c\xb3\x27\xbe\x55" | ||
892 | "\xec\x60\xf7\x8e\x02\x99\x30\xc7" | ||
893 | "\x3b\xd2\x69\x00\x74\x0b\xa2\x16" | ||
894 | "\xad\x44\xdb\x4f\xe6\x7d\x14\x88" | ||
895 | "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa" | ||
896 | "\x91\x05\x9c\x33\xca\x3e\xd5\x6c" | ||
897 | "\x03\x77\x0e\xa5\x19\xb0\x47\xde" | ||
898 | "\x52\xe9\x80\x17\x8b\x22\xb9\x2d" | ||
899 | "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f" | ||
900 | "\x36\xcd\x41\xd8\x6f\x06\x7a\x11" | ||
901 | "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83" | ||
902 | "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5" | ||
903 | "\x69\x00\x97\x0b\xa2\x39\xd0\x44" | ||
904 | "\xdb\x72\x09\x7d\x14\xab\x1f\xb6" | ||
905 | "\x4d\xe4\x58\xef\x86\x1d\x91\x28" | ||
906 | "\xbf\x33\xca\x61\xf8\x6c\x03\x9a" | ||
907 | "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c" | ||
908 | "\x80\x17\xae\x22\xb9\x50\xe7\x5b" | ||
909 | "\xf2\x89\x20\x94\x2b\xc2\x36\xcd" | ||
910 | "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f" | ||
911 | "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1" | ||
912 | "\x25\xbc\x53\xea\x5e\xf5\x8c\x00" | ||
913 | "\x97\x2e\xc5\x39\xd0\x67\xfe\x72" | ||
914 | "\x09\xa0\x14\xab\x42\xd9\x4d\xe4" | ||
915 | "\x7b\x12\x86\x1d\xb4\x28\xbf\x56" | ||
916 | "\xed\x61\xf8\x8f\x03\x9a\x31\xc8" | ||
917 | "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17" | ||
918 | "\xae\x45\xdc\x50\xe7\x7e\x15\x89" | ||
919 | "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb" | ||
920 | "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d" | ||
921 | "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf" | ||
922 | "\x53\xea\x81\x18\x8c\x23\xba\x2e" | ||
923 | "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0" | ||
924 | "\x37\xce\x42\xd9\x70\x07\x7b\x12" | ||
925 | "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84" | ||
926 | "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6" | ||
927 | "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45" | ||
928 | "\xdc\x73\x0a\x7e\x15\xac\x20\xb7" | ||
929 | "\x4e\xe5\x59\xf0\x87\x1e\x92\x29" | ||
930 | "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b" | ||
931 | "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d" | ||
932 | "\x81\x18\xaf\x23\xba\x51\xe8\x5c" | ||
933 | "\xf3\x8a\x21\x95\x2c\xc3\x37\xce" | ||
934 | "\x65\xfc\x70\x07\x9e\x12\xa9\x40" | ||
935 | "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2" | ||
936 | "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01" | ||
937 | "\x98\x2f\xc6\x3a\xd1\x68\xff\x73" | ||
938 | "\x0a\xa1\x15\xac\x43\xda\x4e\xe5" | ||
939 | "\x7c\x13\x87\x1e\xb5\x29\xc0\x57" | ||
940 | "\xee\x62\xf9\x90\x04\x9b\x32\xc9" | ||
941 | "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18" | ||
942 | "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a" | ||
943 | "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc" | ||
944 | "\x93\x07\x9e\x35\xcc\x40\xd7\x6e" | ||
945 | "\x05\x79\x10\xa7\x1b\xb2\x49\xe0" | ||
946 | "\x54\xeb\x82\x19\x8d\x24\xbb\x2f" | ||
947 | "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1" | ||
948 | "\x38\xcf\x43\xda\x71\x08\x7c\x13" | ||
949 | "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85" | ||
950 | "\x1c\x90\x27\xbe\x32\xc9\x60\xf7" | ||
951 | "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46" | ||
952 | "\xdd\x74\x0b\x7f\x16\xad\x21\xb8" | ||
953 | "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a" | ||
954 | "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c" | ||
955 | "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e" | ||
956 | "\x82\x19\xb0\x24\xbb\x52\xe9\x5d" | ||
957 | "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf" | ||
958 | "\x66\xfd\x71\x08\x9f\x13\xaa\x41" | ||
959 | "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3" | ||
960 | "\x27\xbe\x55\xec\x60\xf7\x8e\x02" | ||
961 | "\x99\x30\xc7\x3b\xd2\x69\x00\x74" | ||
962 | "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6" | ||
963 | "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58" | ||
964 | "\xef\x63\xfa\x91\x05\x9c\x33\xca" | ||
965 | "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19" | ||
966 | "\xb0\x47\xde\x52\xe9\x80\x17\x8b" | ||
967 | "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd" | ||
968 | "\x94\x08\x9f\x36\xcd\x41\xd8\x6f" | ||
969 | "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1" | ||
970 | "\x55\xec\x83\x1a\x8e\x25\xbc\x30" | ||
971 | "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2" | ||
972 | "\x39\xd0\x44\xdb\x72\x09\x7d\x14" | ||
973 | "\xab\x1f\xb6\x4d\xe4\x58\xef\x86" | ||
974 | "\x1d\x91\x28\xbf\x33\xca\x61\xf8" | ||
975 | "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47" | ||
976 | "\xde\x75\x0c\x80\x17\xae\x22\xb9" | ||
977 | "\x50\xe7\x5b\xf2\x89\x20\x94\x2b" | ||
978 | "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d" | ||
979 | "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f" | ||
980 | "\x83\x1a\xb1\x25\xbc\x53\xea\x5e" | ||
981 | "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0" | ||
982 | "\x67\xfe\x72\x09\xa0\x14\xab\x42" | ||
983 | "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4" | ||
984 | "\x28\xbf\x56\xed\x61\xf8\x8f\x03" | ||
985 | "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75" | ||
986 | "\x0c\xa3\x17\xae\x45\xdc\x50\xe7" | ||
987 | "\x7e\x15\x89\x20\xb7\x2b\xc2\x59" | ||
988 | "\xf0\x64\xfb\x92\x06\x9d\x34\xcb" | ||
989 | "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a" | ||
990 | "\xb1\x48\xdf\x53\xea\x81\x18\x8c" | ||
991 | "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe" | ||
992 | "\x95\x09\xa0\x37\xce\x42\xd9\x70" | ||
993 | "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2" | ||
994 | "\x56\xed\x84\x1b\x8f\x26\xbd\x31" | ||
995 | "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3" | ||
996 | "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15" | ||
997 | "\xac\x20\xb7\x4e\xe5\x59\xf0\x87" | ||
998 | "\x1e\x92\x29\xc0\x34\xcb\x62\xf9" | ||
999 | "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48" | ||
1000 | "\xdf\x76\x0d\x81\x18\xaf\x23\xba" | ||
1001 | "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c" | ||
1002 | "\xc3\x37\xce\x65\xfc\x70\x07\x9e" | ||
1003 | "\x12\xa9\x40\xd7\x4b\xe2\x79\x10" | ||
1004 | "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f" | ||
1005 | "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1" | ||
1006 | "\x68\xff\x73\x0a\xa1\x15\xac\x43" | ||
1007 | "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5" | ||
1008 | "\x29\xc0\x57\xee\x62\xf9\x90\x04" | ||
1009 | "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76" | ||
1010 | "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8" | ||
1011 | "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a" | ||
1012 | "\xf1\x65\xfc\x93\x07\x9e\x35\xcc" | ||
1013 | "\x40\xd7\x6e\x05\x79\x10\xa7\x1b" | ||
1014 | "\xb2\x49\xe0\x54\xeb\x82\x19\x8d" | ||
1015 | "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff" | ||
1016 | "\x96\x0a\xa1\x38\xcf\x43\xda\x71" | ||
1017 | "\x08\x7c\x13\xaa\x1e\xb5\x4c", | ||
1018 | .psize = 1023, | ||
1019 | .digest = "\xc5\xce\x0c\xca\x01\x4f\x53\x3a" | ||
1020 | "\x32\x32\x17\xcc\xd4\x6a\x71\xa9" | ||
1021 | "\xf3\xed\x50\x10\x64\x8e\x06\xbe" | ||
1022 | "\x9b\x4a\xa6\xbb\x05\x89\x59\x51", | ||
1023 | } | ||
585 | }; | 1024 | }; |
586 | 1025 | ||
587 | /* | 1026 | /* |
588 | * SHA384 test vectors from from NIST and kerneli | 1027 | * SHA384 test vectors from from NIST and kerneli |
589 | */ | 1028 | */ |
590 | #define SHA384_TEST_VECTORS 4 | 1029 | #define SHA384_TEST_VECTORS 6 |
591 | 1030 | ||
592 | static struct hash_testvec sha384_tv_template[] = { | 1031 | static struct hash_testvec sha384_tv_template[] = { |
593 | { | 1032 | { |
1033 | .plaintext = "", | ||
1034 | .psize = 0, | ||
1035 | .digest = "\x38\xb0\x60\xa7\x51\xac\x96\x38" | ||
1036 | "\x4c\xd9\x32\x7e\xb1\xb1\xe3\x6a" | ||
1037 | "\x21\xfd\xb7\x11\x14\xbe\x07\x43" | ||
1038 | "\x4c\x0c\xc7\xbf\x63\xf6\xe1\xda" | ||
1039 | "\x27\x4e\xde\xbf\xe7\x6f\x65\xfb" | ||
1040 | "\xd5\x1a\xd2\xf1\x48\x98\xb9\x5b", | ||
1041 | }, { | ||
594 | .plaintext= "abc", | 1042 | .plaintext= "abc", |
595 | .psize = 3, | 1043 | .psize = 3, |
596 | .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b" | 1044 | .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b" |
@@ -630,16 +1078,163 @@ static struct hash_testvec sha384_tv_template[] = { | |||
630 | "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4", | 1078 | "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4", |
631 | .np = 4, | 1079 | .np = 4, |
632 | .tap = { 26, 26, 26, 26 } | 1080 | .tap = { 26, 26, 26, 26 } |
633 | }, | 1081 | }, { |
1082 | .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3" | ||
1083 | "\x7a\x11\x85\x1c\xb3\x27\xbe\x55" | ||
1084 | "\xec\x60\xf7\x8e\x02\x99\x30\xc7" | ||
1085 | "\x3b\xd2\x69\x00\x74\x0b\xa2\x16" | ||
1086 | "\xad\x44\xdb\x4f\xe6\x7d\x14\x88" | ||
1087 | "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa" | ||
1088 | "\x91\x05\x9c\x33\xca\x3e\xd5\x6c" | ||
1089 | "\x03\x77\x0e\xa5\x19\xb0\x47\xde" | ||
1090 | "\x52\xe9\x80\x17\x8b\x22\xb9\x2d" | ||
1091 | "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f" | ||
1092 | "\x36\xcd\x41\xd8\x6f\x06\x7a\x11" | ||
1093 | "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83" | ||
1094 | "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5" | ||
1095 | "\x69\x00\x97\x0b\xa2\x39\xd0\x44" | ||
1096 | "\xdb\x72\x09\x7d\x14\xab\x1f\xb6" | ||
1097 | "\x4d\xe4\x58\xef\x86\x1d\x91\x28" | ||
1098 | "\xbf\x33\xca\x61\xf8\x6c\x03\x9a" | ||
1099 | "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c" | ||
1100 | "\x80\x17\xae\x22\xb9\x50\xe7\x5b" | ||
1101 | "\xf2\x89\x20\x94\x2b\xc2\x36\xcd" | ||
1102 | "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f" | ||
1103 | "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1" | ||
1104 | "\x25\xbc\x53\xea\x5e\xf5\x8c\x00" | ||
1105 | "\x97\x2e\xc5\x39\xd0\x67\xfe\x72" | ||
1106 | "\x09\xa0\x14\xab\x42\xd9\x4d\xe4" | ||
1107 | "\x7b\x12\x86\x1d\xb4\x28\xbf\x56" | ||
1108 | "\xed\x61\xf8\x8f\x03\x9a\x31\xc8" | ||
1109 | "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17" | ||
1110 | "\xae\x45\xdc\x50\xe7\x7e\x15\x89" | ||
1111 | "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb" | ||
1112 | "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d" | ||
1113 | "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf" | ||
1114 | "\x53\xea\x81\x18\x8c\x23\xba\x2e" | ||
1115 | "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0" | ||
1116 | "\x37\xce\x42\xd9\x70\x07\x7b\x12" | ||
1117 | "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84" | ||
1118 | "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6" | ||
1119 | "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45" | ||
1120 | "\xdc\x73\x0a\x7e\x15\xac\x20\xb7" | ||
1121 | "\x4e\xe5\x59\xf0\x87\x1e\x92\x29" | ||
1122 | "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b" | ||
1123 | "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d" | ||
1124 | "\x81\x18\xaf\x23\xba\x51\xe8\x5c" | ||
1125 | "\xf3\x8a\x21\x95\x2c\xc3\x37\xce" | ||
1126 | "\x65\xfc\x70\x07\x9e\x12\xa9\x40" | ||
1127 | "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2" | ||
1128 | "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01" | ||
1129 | "\x98\x2f\xc6\x3a\xd1\x68\xff\x73" | ||
1130 | "\x0a\xa1\x15\xac\x43\xda\x4e\xe5" | ||
1131 | "\x7c\x13\x87\x1e\xb5\x29\xc0\x57" | ||
1132 | "\xee\x62\xf9\x90\x04\x9b\x32\xc9" | ||
1133 | "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18" | ||
1134 | "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a" | ||
1135 | "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc" | ||
1136 | "\x93\x07\x9e\x35\xcc\x40\xd7\x6e" | ||
1137 | "\x05\x79\x10\xa7\x1b\xb2\x49\xe0" | ||
1138 | "\x54\xeb\x82\x19\x8d\x24\xbb\x2f" | ||
1139 | "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1" | ||
1140 | "\x38\xcf\x43\xda\x71\x08\x7c\x13" | ||
1141 | "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85" | ||
1142 | "\x1c\x90\x27\xbe\x32\xc9\x60\xf7" | ||
1143 | "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46" | ||
1144 | "\xdd\x74\x0b\x7f\x16\xad\x21\xb8" | ||
1145 | "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a" | ||
1146 | "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c" | ||
1147 | "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e" | ||
1148 | "\x82\x19\xb0\x24\xbb\x52\xe9\x5d" | ||
1149 | "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf" | ||
1150 | "\x66\xfd\x71\x08\x9f\x13\xaa\x41" | ||
1151 | "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3" | ||
1152 | "\x27\xbe\x55\xec\x60\xf7\x8e\x02" | ||
1153 | "\x99\x30\xc7\x3b\xd2\x69\x00\x74" | ||
1154 | "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6" | ||
1155 | "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58" | ||
1156 | "\xef\x63\xfa\x91\x05\x9c\x33\xca" | ||
1157 | "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19" | ||
1158 | "\xb0\x47\xde\x52\xe9\x80\x17\x8b" | ||
1159 | "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd" | ||
1160 | "\x94\x08\x9f\x36\xcd\x41\xd8\x6f" | ||
1161 | "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1" | ||
1162 | "\x55\xec\x83\x1a\x8e\x25\xbc\x30" | ||
1163 | "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2" | ||
1164 | "\x39\xd0\x44\xdb\x72\x09\x7d\x14" | ||
1165 | "\xab\x1f\xb6\x4d\xe4\x58\xef\x86" | ||
1166 | "\x1d\x91\x28\xbf\x33\xca\x61\xf8" | ||
1167 | "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47" | ||
1168 | "\xde\x75\x0c\x80\x17\xae\x22\xb9" | ||
1169 | "\x50\xe7\x5b\xf2\x89\x20\x94\x2b" | ||
1170 | "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d" | ||
1171 | "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f" | ||
1172 | "\x83\x1a\xb1\x25\xbc\x53\xea\x5e" | ||
1173 | "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0" | ||
1174 | "\x67\xfe\x72\x09\xa0\x14\xab\x42" | ||
1175 | "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4" | ||
1176 | "\x28\xbf\x56\xed\x61\xf8\x8f\x03" | ||
1177 | "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75" | ||
1178 | "\x0c\xa3\x17\xae\x45\xdc\x50\xe7" | ||
1179 | "\x7e\x15\x89\x20\xb7\x2b\xc2\x59" | ||
1180 | "\xf0\x64\xfb\x92\x06\x9d\x34\xcb" | ||
1181 | "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a" | ||
1182 | "\xb1\x48\xdf\x53\xea\x81\x18\x8c" | ||
1183 | "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe" | ||
1184 | "\x95\x09\xa0\x37\xce\x42\xd9\x70" | ||
1185 | "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2" | ||
1186 | "\x56\xed\x84\x1b\x8f\x26\xbd\x31" | ||
1187 | "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3" | ||
1188 | "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15" | ||
1189 | "\xac\x20\xb7\x4e\xe5\x59\xf0\x87" | ||
1190 | "\x1e\x92\x29\xc0\x34\xcb\x62\xf9" | ||
1191 | "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48" | ||
1192 | "\xdf\x76\x0d\x81\x18\xaf\x23\xba" | ||
1193 | "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c" | ||
1194 | "\xc3\x37\xce\x65\xfc\x70\x07\x9e" | ||
1195 | "\x12\xa9\x40\xd7\x4b\xe2\x79\x10" | ||
1196 | "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f" | ||
1197 | "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1" | ||
1198 | "\x68\xff\x73\x0a\xa1\x15\xac\x43" | ||
1199 | "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5" | ||
1200 | "\x29\xc0\x57\xee\x62\xf9\x90\x04" | ||
1201 | "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76" | ||
1202 | "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8" | ||
1203 | "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a" | ||
1204 | "\xf1\x65\xfc\x93\x07\x9e\x35\xcc" | ||
1205 | "\x40\xd7\x6e\x05\x79\x10\xa7\x1b" | ||
1206 | "\xb2\x49\xe0\x54\xeb\x82\x19\x8d" | ||
1207 | "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff" | ||
1208 | "\x96\x0a\xa1\x38\xcf\x43\xda\x71" | ||
1209 | "\x08\x7c\x13\xaa\x1e\xb5\x4c", | ||
1210 | .psize = 1023, | ||
1211 | .digest = "\x4d\x97\x23\xc8\xea\x7a\x7c\x15" | ||
1212 | "\xb8\xff\x97\x9c\xf5\x13\x4f\x31" | ||
1213 | "\xde\x67\xf7\x24\x73\xcd\x70\x1c" | ||
1214 | "\x03\x4a\xba\x8a\x87\x49\xfe\xdc" | ||
1215 | "\x75\x29\x62\x83\xae\x3f\x17\xab" | ||
1216 | "\xfd\x10\x4d\x8e\x17\x1c\x1f\xca", | ||
1217 | } | ||
634 | }; | 1218 | }; |
635 | 1219 | ||
636 | /* | 1220 | /* |
637 | * SHA512 test vectors from from NIST and kerneli | 1221 | * SHA512 test vectors from from NIST and kerneli |
638 | */ | 1222 | */ |
639 | #define SHA512_TEST_VECTORS 4 | 1223 | #define SHA512_TEST_VECTORS 6 |
640 | 1224 | ||
641 | static struct hash_testvec sha512_tv_template[] = { | 1225 | static struct hash_testvec sha512_tv_template[] = { |
642 | { | 1226 | { |
1227 | .plaintext = "", | ||
1228 | .psize = 0, | ||
1229 | .digest = "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd" | ||
1230 | "\xf1\x54\x28\x50\xd6\x6d\x80\x07" | ||
1231 | "\xd6\x20\xe4\x05\x0b\x57\x15\xdc" | ||
1232 | "\x83\xf4\xa9\x21\xd3\x6c\xe9\xce" | ||
1233 | "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0" | ||
1234 | "\xff\x83\x18\xd2\x87\x7e\xec\x2f" | ||
1235 | "\x63\xb9\x31\xbd\x47\x41\x7a\x81" | ||
1236 | "\xa5\x38\x32\x7a\xf9\x27\xda\x3e", | ||
1237 | }, { | ||
643 | .plaintext = "abc", | 1238 | .plaintext = "abc", |
644 | .psize = 3, | 1239 | .psize = 3, |
645 | .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba" | 1240 | .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba" |
@@ -687,7 +1282,145 @@ static struct hash_testvec sha512_tv_template[] = { | |||
687 | "\xed\xb4\x19\x87\x23\x28\x50\xc9", | 1282 | "\xed\xb4\x19\x87\x23\x28\x50\xc9", |
688 | .np = 4, | 1283 | .np = 4, |
689 | .tap = { 26, 26, 26, 26 } | 1284 | .tap = { 26, 26, 26, 26 } |
690 | }, | 1285 | }, { |
1286 | .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3" | ||
1287 | "\x7a\x11\x85\x1c\xb3\x27\xbe\x55" | ||
1288 | "\xec\x60\xf7\x8e\x02\x99\x30\xc7" | ||
1289 | "\x3b\xd2\x69\x00\x74\x0b\xa2\x16" | ||
1290 | "\xad\x44\xdb\x4f\xe6\x7d\x14\x88" | ||
1291 | "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa" | ||
1292 | "\x91\x05\x9c\x33\xca\x3e\xd5\x6c" | ||
1293 | "\x03\x77\x0e\xa5\x19\xb0\x47\xde" | ||
1294 | "\x52\xe9\x80\x17\x8b\x22\xb9\x2d" | ||
1295 | "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f" | ||
1296 | "\x36\xcd\x41\xd8\x6f\x06\x7a\x11" | ||
1297 | "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83" | ||
1298 | "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5" | ||
1299 | "\x69\x00\x97\x0b\xa2\x39\xd0\x44" | ||
1300 | "\xdb\x72\x09\x7d\x14\xab\x1f\xb6" | ||
1301 | "\x4d\xe4\x58\xef\x86\x1d\x91\x28" | ||
1302 | "\xbf\x33\xca\x61\xf8\x6c\x03\x9a" | ||
1303 | "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c" | ||
1304 | "\x80\x17\xae\x22\xb9\x50\xe7\x5b" | ||
1305 | "\xf2\x89\x20\x94\x2b\xc2\x36\xcd" | ||
1306 | "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f" | ||
1307 | "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1" | ||
1308 | "\x25\xbc\x53\xea\x5e\xf5\x8c\x00" | ||
1309 | "\x97\x2e\xc5\x39\xd0\x67\xfe\x72" | ||
1310 | "\x09\xa0\x14\xab\x42\xd9\x4d\xe4" | ||
1311 | "\x7b\x12\x86\x1d\xb4\x28\xbf\x56" | ||
1312 | "\xed\x61\xf8\x8f\x03\x9a\x31\xc8" | ||
1313 | "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17" | ||
1314 | "\xae\x45\xdc\x50\xe7\x7e\x15\x89" | ||
1315 | "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb" | ||
1316 | "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d" | ||
1317 | "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf" | ||
1318 | "\x53\xea\x81\x18\x8c\x23\xba\x2e" | ||
1319 | "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0" | ||
1320 | "\x37\xce\x42\xd9\x70\x07\x7b\x12" | ||
1321 | "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84" | ||
1322 | "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6" | ||
1323 | "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45" | ||
1324 | "\xdc\x73\x0a\x7e\x15\xac\x20\xb7" | ||
1325 | "\x4e\xe5\x59\xf0\x87\x1e\x92\x29" | ||
1326 | "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b" | ||
1327 | "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d" | ||
1328 | "\x81\x18\xaf\x23\xba\x51\xe8\x5c" | ||
1329 | "\xf3\x8a\x21\x95\x2c\xc3\x37\xce" | ||
1330 | "\x65\xfc\x70\x07\x9e\x12\xa9\x40" | ||
1331 | "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2" | ||
1332 | "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01" | ||
1333 | "\x98\x2f\xc6\x3a\xd1\x68\xff\x73" | ||
1334 | "\x0a\xa1\x15\xac\x43\xda\x4e\xe5" | ||
1335 | "\x7c\x13\x87\x1e\xb5\x29\xc0\x57" | ||
1336 | "\xee\x62\xf9\x90\x04\x9b\x32\xc9" | ||
1337 | "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18" | ||
1338 | "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a" | ||
1339 | "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc" | ||
1340 | "\x93\x07\x9e\x35\xcc\x40\xd7\x6e" | ||
1341 | "\x05\x79\x10\xa7\x1b\xb2\x49\xe0" | ||
1342 | "\x54\xeb\x82\x19\x8d\x24\xbb\x2f" | ||
1343 | "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1" | ||
1344 | "\x38\xcf\x43\xda\x71\x08\x7c\x13" | ||
1345 | "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85" | ||
1346 | "\x1c\x90\x27\xbe\x32\xc9\x60\xf7" | ||
1347 | "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46" | ||
1348 | "\xdd\x74\x0b\x7f\x16\xad\x21\xb8" | ||
1349 | "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a" | ||
1350 | "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c" | ||
1351 | "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e" | ||
1352 | "\x82\x19\xb0\x24\xbb\x52\xe9\x5d" | ||
1353 | "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf" | ||
1354 | "\x66\xfd\x71\x08\x9f\x13\xaa\x41" | ||
1355 | "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3" | ||
1356 | "\x27\xbe\x55\xec\x60\xf7\x8e\x02" | ||
1357 | "\x99\x30\xc7\x3b\xd2\x69\x00\x74" | ||
1358 | "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6" | ||
1359 | "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58" | ||
1360 | "\xef\x63\xfa\x91\x05\x9c\x33\xca" | ||
1361 | "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19" | ||
1362 | "\xb0\x47\xde\x52\xe9\x80\x17\x8b" | ||
1363 | "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd" | ||
1364 | "\x94\x08\x9f\x36\xcd\x41\xd8\x6f" | ||
1365 | "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1" | ||
1366 | "\x55\xec\x83\x1a\x8e\x25\xbc\x30" | ||
1367 | "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2" | ||
1368 | "\x39\xd0\x44\xdb\x72\x09\x7d\x14" | ||
1369 | "\xab\x1f\xb6\x4d\xe4\x58\xef\x86" | ||
1370 | "\x1d\x91\x28\xbf\x33\xca\x61\xf8" | ||
1371 | "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47" | ||
1372 | "\xde\x75\x0c\x80\x17\xae\x22\xb9" | ||
1373 | "\x50\xe7\x5b\xf2\x89\x20\x94\x2b" | ||
1374 | "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d" | ||
1375 | "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f" | ||
1376 | "\x83\x1a\xb1\x25\xbc\x53\xea\x5e" | ||
1377 | "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0" | ||
1378 | "\x67\xfe\x72\x09\xa0\x14\xab\x42" | ||
1379 | "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4" | ||
1380 | "\x28\xbf\x56\xed\x61\xf8\x8f\x03" | ||
1381 | "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75" | ||
1382 | "\x0c\xa3\x17\xae\x45\xdc\x50\xe7" | ||
1383 | "\x7e\x15\x89\x20\xb7\x2b\xc2\x59" | ||
1384 | "\xf0\x64\xfb\x92\x06\x9d\x34\xcb" | ||
1385 | "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a" | ||
1386 | "\xb1\x48\xdf\x53\xea\x81\x18\x8c" | ||
1387 | "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe" | ||
1388 | "\x95\x09\xa0\x37\xce\x42\xd9\x70" | ||
1389 | "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2" | ||
1390 | "\x56\xed\x84\x1b\x8f\x26\xbd\x31" | ||
1391 | "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3" | ||
1392 | "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15" | ||
1393 | "\xac\x20\xb7\x4e\xe5\x59\xf0\x87" | ||
1394 | "\x1e\x92\x29\xc0\x34\xcb\x62\xf9" | ||
1395 | "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48" | ||
1396 | "\xdf\x76\x0d\x81\x18\xaf\x23\xba" | ||
1397 | "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c" | ||
1398 | "\xc3\x37\xce\x65\xfc\x70\x07\x9e" | ||
1399 | "\x12\xa9\x40\xd7\x4b\xe2\x79\x10" | ||
1400 | "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f" | ||
1401 | "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1" | ||
1402 | "\x68\xff\x73\x0a\xa1\x15\xac\x43" | ||
1403 | "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5" | ||
1404 | "\x29\xc0\x57\xee\x62\xf9\x90\x04" | ||
1405 | "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76" | ||
1406 | "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8" | ||
1407 | "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a" | ||
1408 | "\xf1\x65\xfc\x93\x07\x9e\x35\xcc" | ||
1409 | "\x40\xd7\x6e\x05\x79\x10\xa7\x1b" | ||
1410 | "\xb2\x49\xe0\x54\xeb\x82\x19\x8d" | ||
1411 | "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff" | ||
1412 | "\x96\x0a\xa1\x38\xcf\x43\xda\x71" | ||
1413 | "\x08\x7c\x13\xaa\x1e\xb5\x4c", | ||
1414 | .psize = 1023, | ||
1415 | .digest = "\x76\xc9\xd4\x91\x7a\x5f\x0f\xaa" | ||
1416 | "\x13\x39\xf3\x01\x7a\xfa\xe5\x41" | ||
1417 | "\x5f\x0b\xf8\xeb\x32\xfc\xbf\xb0" | ||
1418 | "\xfa\x8c\xcd\x17\x83\xe2\xfa\xeb" | ||
1419 | "\x1c\x19\xde\xe2\x75\xdc\x34\x64" | ||
1420 | "\x5f\x35\x9c\x61\x2f\x10\xf9\xec" | ||
1421 | "\x59\xca\x9d\xcc\x25\x0c\x43\xba" | ||
1422 | "\x85\xa8\xf8\xfe\xb5\x24\xb2\xee", | ||
1423 | } | ||
691 | }; | 1424 | }; |
692 | 1425 | ||
693 | 1426 | ||
@@ -12823,11 +13556,11 @@ static struct cipher_testvec cast6_xts_dec_tv_template[] = { | |||
12823 | #define AES_CBC_DEC_TEST_VECTORS 5 | 13556 | #define AES_CBC_DEC_TEST_VECTORS 5 |
12824 | #define HMAC_MD5_ECB_CIPHER_NULL_ENC_TEST_VECTORS 2 | 13557 | #define HMAC_MD5_ECB_CIPHER_NULL_ENC_TEST_VECTORS 2 |
12825 | #define HMAC_MD5_ECB_CIPHER_NULL_DEC_TEST_VECTORS 2 | 13558 | #define HMAC_MD5_ECB_CIPHER_NULL_DEC_TEST_VECTORS 2 |
12826 | #define HMAC_SHA1_ECB_CIPHER_NULL_ENC_TEST_VECTORS 2 | 13559 | #define HMAC_SHA1_ECB_CIPHER_NULL_ENC_TEST_VEC 2 |
12827 | #define HMAC_SHA1_ECB_CIPHER_NULL_DEC_TEST_VECTORS 2 | 13560 | #define HMAC_SHA1_ECB_CIPHER_NULL_DEC_TEST_VEC 2 |
12828 | #define HMAC_SHA1_AES_CBC_ENC_TEST_VECTORS 7 | 13561 | #define HMAC_SHA1_AES_CBC_ENC_TEST_VEC 7 |
12829 | #define HMAC_SHA256_AES_CBC_ENC_TEST_VECTORS 7 | 13562 | #define HMAC_SHA256_AES_CBC_ENC_TEST_VEC 7 |
12830 | #define HMAC_SHA512_AES_CBC_ENC_TEST_VECTORS 7 | 13563 | #define HMAC_SHA512_AES_CBC_ENC_TEST_VEC 7 |
12831 | #define AES_LRW_ENC_TEST_VECTORS 8 | 13564 | #define AES_LRW_ENC_TEST_VECTORS 8 |
12832 | #define AES_LRW_DEC_TEST_VECTORS 8 | 13565 | #define AES_LRW_DEC_TEST_VECTORS 8 |
12833 | #define AES_XTS_ENC_TEST_VECTORS 5 | 13566 | #define AES_XTS_ENC_TEST_VECTORS 5 |
@@ -12844,7 +13577,7 @@ static struct cipher_testvec cast6_xts_dec_tv_template[] = { | |||
12844 | #define AES_GCM_4106_DEC_TEST_VECTORS 7 | 13577 | #define AES_GCM_4106_DEC_TEST_VECTORS 7 |
12845 | #define AES_GCM_4543_ENC_TEST_VECTORS 1 | 13578 | #define AES_GCM_4543_ENC_TEST_VECTORS 1 |
12846 | #define AES_GCM_4543_DEC_TEST_VECTORS 2 | 13579 | #define AES_GCM_4543_DEC_TEST_VECTORS 2 |
12847 | #define AES_CCM_ENC_TEST_VECTORS 7 | 13580 | #define AES_CCM_ENC_TEST_VECTORS 8 |
12848 | #define AES_CCM_DEC_TEST_VECTORS 7 | 13581 | #define AES_CCM_DEC_TEST_VECTORS 7 |
12849 | #define AES_CCM_4309_ENC_TEST_VECTORS 7 | 13582 | #define AES_CCM_4309_ENC_TEST_VECTORS 7 |
12850 | #define AES_CCM_4309_DEC_TEST_VECTORS 10 | 13583 | #define AES_CCM_4309_DEC_TEST_VECTORS 10 |
@@ -13715,7 +14448,7 @@ static struct aead_testvec hmac_md5_ecb_cipher_null_dec_tv_template[] = { | |||
13715 | }, | 14448 | }, |
13716 | }; | 14449 | }; |
13717 | 14450 | ||
13718 | static struct aead_testvec hmac_sha1_aes_cbc_enc_tv_template[] = { | 14451 | static struct aead_testvec hmac_sha1_aes_cbc_enc_tv_temp[] = { |
13719 | { /* RFC 3602 Case 1 */ | 14452 | { /* RFC 3602 Case 1 */ |
13720 | #ifdef __LITTLE_ENDIAN | 14453 | #ifdef __LITTLE_ENDIAN |
13721 | .key = "\x08\x00" /* rta length */ | 14454 | .key = "\x08\x00" /* rta length */ |
@@ -13964,7 +14697,7 @@ static struct aead_testvec hmac_sha1_aes_cbc_enc_tv_template[] = { | |||
13964 | }, | 14697 | }, |
13965 | }; | 14698 | }; |
13966 | 14699 | ||
13967 | static struct aead_testvec hmac_sha1_ecb_cipher_null_enc_tv_template[] = { | 14700 | static struct aead_testvec hmac_sha1_ecb_cipher_null_enc_tv_temp[] = { |
13968 | { /* Input data from RFC 2410 Case 1 */ | 14701 | { /* Input data from RFC 2410 Case 1 */ |
13969 | #ifdef __LITTLE_ENDIAN | 14702 | #ifdef __LITTLE_ENDIAN |
13970 | .key = "\x08\x00" /* rta length */ | 14703 | .key = "\x08\x00" /* rta length */ |
@@ -14010,7 +14743,7 @@ static struct aead_testvec hmac_sha1_ecb_cipher_null_enc_tv_template[] = { | |||
14010 | }, | 14743 | }, |
14011 | }; | 14744 | }; |
14012 | 14745 | ||
14013 | static struct aead_testvec hmac_sha1_ecb_cipher_null_dec_tv_template[] = { | 14746 | static struct aead_testvec hmac_sha1_ecb_cipher_null_dec_tv_temp[] = { |
14014 | { | 14747 | { |
14015 | #ifdef __LITTLE_ENDIAN | 14748 | #ifdef __LITTLE_ENDIAN |
14016 | .key = "\x08\x00" /* rta length */ | 14749 | .key = "\x08\x00" /* rta length */ |
@@ -14056,7 +14789,7 @@ static struct aead_testvec hmac_sha1_ecb_cipher_null_dec_tv_template[] = { | |||
14056 | }, | 14789 | }, |
14057 | }; | 14790 | }; |
14058 | 14791 | ||
14059 | static struct aead_testvec hmac_sha256_aes_cbc_enc_tv_template[] = { | 14792 | static struct aead_testvec hmac_sha256_aes_cbc_enc_tv_temp[] = { |
14060 | { /* RFC 3602 Case 1 */ | 14793 | { /* RFC 3602 Case 1 */ |
14061 | #ifdef __LITTLE_ENDIAN | 14794 | #ifdef __LITTLE_ENDIAN |
14062 | .key = "\x08\x00" /* rta length */ | 14795 | .key = "\x08\x00" /* rta length */ |
@@ -14319,7 +15052,7 @@ static struct aead_testvec hmac_sha256_aes_cbc_enc_tv_template[] = { | |||
14319 | }, | 15052 | }, |
14320 | }; | 15053 | }; |
14321 | 15054 | ||
14322 | static struct aead_testvec hmac_sha512_aes_cbc_enc_tv_template[] = { | 15055 | static struct aead_testvec hmac_sha512_aes_cbc_enc_tv_temp[] = { |
14323 | { /* RFC 3602 Case 1 */ | 15056 | { /* RFC 3602 Case 1 */ |
14324 | #ifdef __LITTLE_ENDIAN | 15057 | #ifdef __LITTLE_ENDIAN |
14325 | .key = "\x08\x00" /* rta length */ | 15058 | .key = "\x08\x00" /* rta length */ |
@@ -14638,6 +15371,652 @@ static struct aead_testvec hmac_sha512_aes_cbc_enc_tv_template[] = { | |||
14638 | }, | 15371 | }, |
14639 | }; | 15372 | }; |
14640 | 15373 | ||
15374 | #define HMAC_SHA1_DES_CBC_ENC_TEST_VEC 1 | ||
15375 | |||
15376 | static struct aead_testvec hmac_sha1_des_cbc_enc_tv_temp[] = { | ||
15377 | { /*Generated with cryptopp*/ | ||
15378 | #ifdef __LITTLE_ENDIAN | ||
15379 | .key = "\x08\x00" /* rta length */ | ||
15380 | "\x01\x00" /* rta type */ | ||
15381 | #else | ||
15382 | .key = "\x00\x08" /* rta length */ | ||
15383 | "\x00\x01" /* rta type */ | ||
15384 | #endif | ||
15385 | "\x00\x00\x00\x08" /* enc key length */ | ||
15386 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15387 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15388 | "\x22\x33\x44\x55" | ||
15389 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24", | ||
15390 | .klen = 8 + 20 + 8, | ||
15391 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15392 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15393 | .alen = 8, | ||
15394 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15395 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15396 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15397 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15398 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15399 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15400 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15401 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15402 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15403 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15404 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15405 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15406 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15407 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15408 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15409 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15410 | .ilen = 128, | ||
15411 | .result = "\x70\xd6\xde\x64\x87\x17\xf1\xe8" | ||
15412 | "\x54\x31\x85\x37\xed\x6b\x01\x8d" | ||
15413 | "\xe3\xcc\xe0\x1d\x5e\xf3\xfe\xf1" | ||
15414 | "\x41\xaa\x33\x91\xa7\x7d\x99\x88" | ||
15415 | "\x4d\x85\x6e\x2f\xa3\x69\xf5\x82" | ||
15416 | "\x3a\x6f\x25\xcb\x7d\x58\x1f\x9b" | ||
15417 | "\xaa\x9c\x11\xd5\x76\x67\xce\xde" | ||
15418 | "\x56\xd7\x5a\x80\x69\xea\x3a\x02" | ||
15419 | "\xf0\xc7\x7c\xe3\xcb\x40\xe5\x52" | ||
15420 | "\xd1\x10\x92\x78\x0b\x8e\x5b\xf1" | ||
15421 | "\xe3\x26\x1f\xe1\x15\x41\xc7\xba" | ||
15422 | "\x99\xdb\x08\x51\x1c\xd3\x01\xf4" | ||
15423 | "\x87\x47\x39\xb8\xd2\xdd\xbd\xfb" | ||
15424 | "\x66\x13\xdf\x1c\x01\x44\xf0\x7a" | ||
15425 | "\x1a\x6b\x13\xf5\xd5\x0b\xb8\xba" | ||
15426 | "\x53\xba\xe1\x76\xe3\x82\x07\x86" | ||
15427 | "\x95\x16\x20\x09\xf5\x95\x19\xfd" | ||
15428 | "\x3c\xc7\xe0\x42\xc0\x14\x69\xfa" | ||
15429 | "\x5c\x44\xa9\x37", | ||
15430 | .rlen = 128 + 20, | ||
15431 | }, | ||
15432 | }; | ||
15433 | |||
15434 | #define HMAC_SHA224_DES_CBC_ENC_TEST_VEC 1 | ||
15435 | |||
15436 | static struct aead_testvec hmac_sha224_des_cbc_enc_tv_temp[] = { | ||
15437 | { /*Generated with cryptopp*/ | ||
15438 | #ifdef __LITTLE_ENDIAN | ||
15439 | .key = "\x08\x00" /* rta length */ | ||
15440 | "\x01\x00" /* rta type */ | ||
15441 | #else | ||
15442 | .key = "\x00\x08" /* rta length */ | ||
15443 | "\x00\x01" /* rta type */ | ||
15444 | #endif | ||
15445 | "\x00\x00\x00\x08" /* enc key length */ | ||
15446 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15447 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15448 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15449 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24", | ||
15450 | .klen = 8 + 24 + 8, | ||
15451 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15452 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15453 | .alen = 8, | ||
15454 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15455 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15456 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15457 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15458 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15459 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15460 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15461 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15462 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15463 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15464 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15465 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15466 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15467 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15468 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15469 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15470 | .ilen = 128, | ||
15471 | .result = "\x70\xd6\xde\x64\x87\x17\xf1\xe8" | ||
15472 | "\x54\x31\x85\x37\xed\x6b\x01\x8d" | ||
15473 | "\xe3\xcc\xe0\x1d\x5e\xf3\xfe\xf1" | ||
15474 | "\x41\xaa\x33\x91\xa7\x7d\x99\x88" | ||
15475 | "\x4d\x85\x6e\x2f\xa3\x69\xf5\x82" | ||
15476 | "\x3a\x6f\x25\xcb\x7d\x58\x1f\x9b" | ||
15477 | "\xaa\x9c\x11\xd5\x76\x67\xce\xde" | ||
15478 | "\x56\xd7\x5a\x80\x69\xea\x3a\x02" | ||
15479 | "\xf0\xc7\x7c\xe3\xcb\x40\xe5\x52" | ||
15480 | "\xd1\x10\x92\x78\x0b\x8e\x5b\xf1" | ||
15481 | "\xe3\x26\x1f\xe1\x15\x41\xc7\xba" | ||
15482 | "\x99\xdb\x08\x51\x1c\xd3\x01\xf4" | ||
15483 | "\x87\x47\x39\xb8\xd2\xdd\xbd\xfb" | ||
15484 | "\x66\x13\xdf\x1c\x01\x44\xf0\x7a" | ||
15485 | "\x1a\x6b\x13\xf5\xd5\x0b\xb8\xba" | ||
15486 | "\x53\xba\xe1\x76\xe3\x82\x07\x86" | ||
15487 | "\x9c\x2d\x7e\xee\x20\x34\x55\x0a" | ||
15488 | "\xce\xb5\x4e\x64\x53\xe7\xbf\x91" | ||
15489 | "\xab\xd4\xd9\xda\xc9\x12\xae\xf7", | ||
15490 | .rlen = 128 + 24, | ||
15491 | }, | ||
15492 | }; | ||
15493 | |||
15494 | #define HMAC_SHA256_DES_CBC_ENC_TEST_VEC 1 | ||
15495 | |||
15496 | static struct aead_testvec hmac_sha256_des_cbc_enc_tv_temp[] = { | ||
15497 | { /*Generated with cryptopp*/ | ||
15498 | #ifdef __LITTLE_ENDIAN | ||
15499 | .key = "\x08\x00" /* rta length */ | ||
15500 | "\x01\x00" /* rta type */ | ||
15501 | #else | ||
15502 | .key = "\x00\x08" /* rta length */ | ||
15503 | "\x00\x01" /* rta type */ | ||
15504 | #endif | ||
15505 | "\x00\x00\x00\x08" /* enc key length */ | ||
15506 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15507 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15508 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15509 | "\xaa\xbb\xcc\xdd\xee\xff\x11\x22" | ||
15510 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24", | ||
15511 | .klen = 8 + 32 + 8, | ||
15512 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15513 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15514 | .alen = 8, | ||
15515 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15516 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15517 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15518 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15519 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15520 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15521 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15522 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15523 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15524 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15525 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15526 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15527 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15528 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15529 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15530 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15531 | .ilen = 128, | ||
15532 | .result = "\x70\xd6\xde\x64\x87\x17\xf1\xe8" | ||
15533 | "\x54\x31\x85\x37\xed\x6b\x01\x8d" | ||
15534 | "\xe3\xcc\xe0\x1d\x5e\xf3\xfe\xf1" | ||
15535 | "\x41\xaa\x33\x91\xa7\x7d\x99\x88" | ||
15536 | "\x4d\x85\x6e\x2f\xa3\x69\xf5\x82" | ||
15537 | "\x3a\x6f\x25\xcb\x7d\x58\x1f\x9b" | ||
15538 | "\xaa\x9c\x11\xd5\x76\x67\xce\xde" | ||
15539 | "\x56\xd7\x5a\x80\x69\xea\x3a\x02" | ||
15540 | "\xf0\xc7\x7c\xe3\xcb\x40\xe5\x52" | ||
15541 | "\xd1\x10\x92\x78\x0b\x8e\x5b\xf1" | ||
15542 | "\xe3\x26\x1f\xe1\x15\x41\xc7\xba" | ||
15543 | "\x99\xdb\x08\x51\x1c\xd3\x01\xf4" | ||
15544 | "\x87\x47\x39\xb8\xd2\xdd\xbd\xfb" | ||
15545 | "\x66\x13\xdf\x1c\x01\x44\xf0\x7a" | ||
15546 | "\x1a\x6b\x13\xf5\xd5\x0b\xb8\xba" | ||
15547 | "\x53\xba\xe1\x76\xe3\x82\x07\x86" | ||
15548 | "\xc6\x58\xa1\x60\x70\x91\x39\x36" | ||
15549 | "\x50\xf6\x5d\xab\x4b\x51\x4e\x5e" | ||
15550 | "\xde\x63\xde\x76\x52\xde\x9f\xba" | ||
15551 | "\x90\xcf\x15\xf2\xbb\x6e\x84\x00", | ||
15552 | .rlen = 128 + 32, | ||
15553 | }, | ||
15554 | }; | ||
15555 | |||
15556 | #define HMAC_SHA384_DES_CBC_ENC_TEST_VEC 1 | ||
15557 | |||
15558 | static struct aead_testvec hmac_sha384_des_cbc_enc_tv_temp[] = { | ||
15559 | { /*Generated with cryptopp*/ | ||
15560 | #ifdef __LITTLE_ENDIAN | ||
15561 | .key = "\x08\x00" /* rta length */ | ||
15562 | "\x01\x00" /* rta type */ | ||
15563 | #else | ||
15564 | .key = "\x00\x08" /* rta length */ | ||
15565 | "\x00\x01" /* rta type */ | ||
15566 | #endif | ||
15567 | "\x00\x00\x00\x08" /* enc key length */ | ||
15568 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15569 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15570 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15571 | "\xaa\xbb\xcc\xdd\xee\xff\x11\x22" | ||
15572 | "\x33\x44\x55\x66\x77\x88\x99\xaa" | ||
15573 | "\xbb\xcc\xdd\xee\xff\x11\x22\x33" | ||
15574 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24", | ||
15575 | .klen = 8 + 48 + 8, | ||
15576 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15577 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15578 | .alen = 8, | ||
15579 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15580 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15581 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15582 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15583 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15584 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15585 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15586 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15587 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15588 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15589 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15590 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15591 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15592 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15593 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15594 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15595 | .ilen = 128, | ||
15596 | .result = "\x70\xd6\xde\x64\x87\x17\xf1\xe8" | ||
15597 | "\x54\x31\x85\x37\xed\x6b\x01\x8d" | ||
15598 | "\xe3\xcc\xe0\x1d\x5e\xf3\xfe\xf1" | ||
15599 | "\x41\xaa\x33\x91\xa7\x7d\x99\x88" | ||
15600 | "\x4d\x85\x6e\x2f\xa3\x69\xf5\x82" | ||
15601 | "\x3a\x6f\x25\xcb\x7d\x58\x1f\x9b" | ||
15602 | "\xaa\x9c\x11\xd5\x76\x67\xce\xde" | ||
15603 | "\x56\xd7\x5a\x80\x69\xea\x3a\x02" | ||
15604 | "\xf0\xc7\x7c\xe3\xcb\x40\xe5\x52" | ||
15605 | "\xd1\x10\x92\x78\x0b\x8e\x5b\xf1" | ||
15606 | "\xe3\x26\x1f\xe1\x15\x41\xc7\xba" | ||
15607 | "\x99\xdb\x08\x51\x1c\xd3\x01\xf4" | ||
15608 | "\x87\x47\x39\xb8\xd2\xdd\xbd\xfb" | ||
15609 | "\x66\x13\xdf\x1c\x01\x44\xf0\x7a" | ||
15610 | "\x1a\x6b\x13\xf5\xd5\x0b\xb8\xba" | ||
15611 | "\x53\xba\xe1\x76\xe3\x82\x07\x86" | ||
15612 | "\xa8\x8e\x9c\x74\x8c\x2b\x99\xa0" | ||
15613 | "\xc8\x8c\xef\x25\x07\x83\x11\x3a" | ||
15614 | "\x31\x8d\xbe\x3b\x6a\xd7\x96\xfe" | ||
15615 | "\x5e\x67\xb5\x74\xe7\xe7\x85\x61" | ||
15616 | "\x6a\x95\x26\x75\xcc\x53\x89\xf3" | ||
15617 | "\x74\xc9\x2a\x76\x20\xa2\x64\x62", | ||
15618 | .rlen = 128 + 48, | ||
15619 | }, | ||
15620 | }; | ||
15621 | |||
15622 | #define HMAC_SHA512_DES_CBC_ENC_TEST_VEC 1 | ||
15623 | |||
15624 | static struct aead_testvec hmac_sha512_des_cbc_enc_tv_temp[] = { | ||
15625 | { /*Generated with cryptopp*/ | ||
15626 | #ifdef __LITTLE_ENDIAN | ||
15627 | .key = "\x08\x00" /* rta length */ | ||
15628 | "\x01\x00" /* rta type */ | ||
15629 | #else | ||
15630 | .key = "\x00\x08" /* rta length */ | ||
15631 | "\x00\x01" /* rta type */ | ||
15632 | #endif | ||
15633 | "\x00\x00\x00\x08" /* enc key length */ | ||
15634 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15635 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15636 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15637 | "\xaa\xbb\xcc\xdd\xee\xff\x11\x22" | ||
15638 | "\x33\x44\x55\x66\x77\x88\x99\xaa" | ||
15639 | "\xbb\xcc\xdd\xee\xff\x11\x22\x33" | ||
15640 | "\x44\x55\x66\x77\x88\x99\xaa\xbb" | ||
15641 | "\xcc\xdd\xee\xff\x11\x22\x33\x44" | ||
15642 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24", | ||
15643 | .klen = 8 + 64 + 8, | ||
15644 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15645 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15646 | .alen = 8, | ||
15647 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15648 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15649 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15650 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15651 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15652 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15653 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15654 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15655 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15656 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15657 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15658 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15659 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15660 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15661 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15662 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15663 | .ilen = 128, | ||
15664 | .result = "\x70\xd6\xde\x64\x87\x17\xf1\xe8" | ||
15665 | "\x54\x31\x85\x37\xed\x6b\x01\x8d" | ||
15666 | "\xe3\xcc\xe0\x1d\x5e\xf3\xfe\xf1" | ||
15667 | "\x41\xaa\x33\x91\xa7\x7d\x99\x88" | ||
15668 | "\x4d\x85\x6e\x2f\xa3\x69\xf5\x82" | ||
15669 | "\x3a\x6f\x25\xcb\x7d\x58\x1f\x9b" | ||
15670 | "\xaa\x9c\x11\xd5\x76\x67\xce\xde" | ||
15671 | "\x56\xd7\x5a\x80\x69\xea\x3a\x02" | ||
15672 | "\xf0\xc7\x7c\xe3\xcb\x40\xe5\x52" | ||
15673 | "\xd1\x10\x92\x78\x0b\x8e\x5b\xf1" | ||
15674 | "\xe3\x26\x1f\xe1\x15\x41\xc7\xba" | ||
15675 | "\x99\xdb\x08\x51\x1c\xd3\x01\xf4" | ||
15676 | "\x87\x47\x39\xb8\xd2\xdd\xbd\xfb" | ||
15677 | "\x66\x13\xdf\x1c\x01\x44\xf0\x7a" | ||
15678 | "\x1a\x6b\x13\xf5\xd5\x0b\xb8\xba" | ||
15679 | "\x53\xba\xe1\x76\xe3\x82\x07\x86" | ||
15680 | "\xc6\x2c\x73\x88\xb0\x9d\x5f\x3e" | ||
15681 | "\x5b\x78\xca\x0e\xab\x8a\xa3\xbb" | ||
15682 | "\xd9\x1d\xc3\xe3\x05\xac\x76\xfb" | ||
15683 | "\x58\x83\xda\x67\xfb\x21\x24\xa2" | ||
15684 | "\xb1\xa7\xd7\x66\xa6\x8d\xa6\x93" | ||
15685 | "\x97\xe2\xe3\xb8\xaa\x48\x85\xee" | ||
15686 | "\x8c\xf6\x07\x95\x1f\xa6\x6c\x96" | ||
15687 | "\x99\xc7\x5c\x8d\xd8\xb5\x68\x7b", | ||
15688 | .rlen = 128 + 64, | ||
15689 | }, | ||
15690 | }; | ||
15691 | |||
15692 | #define HMAC_SHA1_DES3_EDE_CBC_ENC_TEST_VEC 1 | ||
15693 | |||
15694 | static struct aead_testvec hmac_sha1_des3_ede_cbc_enc_tv_temp[] = { | ||
15695 | { /*Generated with cryptopp*/ | ||
15696 | #ifdef __LITTLE_ENDIAN | ||
15697 | .key = "\x08\x00" /* rta length */ | ||
15698 | "\x01\x00" /* rta type */ | ||
15699 | #else | ||
15700 | .key = "\x00\x08" /* rta length */ | ||
15701 | "\x00\x01" /* rta type */ | ||
15702 | #endif | ||
15703 | "\x00\x00\x00\x18" /* enc key length */ | ||
15704 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15705 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15706 | "\x22\x33\x44\x55" | ||
15707 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24" | ||
15708 | "\x44\x4D\x99\x5A\x12\xD6\x40\xC0" | ||
15709 | "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8", | ||
15710 | .klen = 8 + 20 + 24, | ||
15711 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15712 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15713 | .alen = 8, | ||
15714 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15715 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15716 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15717 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15718 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15719 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15720 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15721 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15722 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15723 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15724 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15725 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15726 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15727 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15728 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15729 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15730 | .ilen = 128, | ||
15731 | .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4" | ||
15732 | "\x67\x17\x21\xc7\x6e\x8a\xd5\x49" | ||
15733 | "\x74\xb3\x49\x05\xc5\x1c\xd0\xed" | ||
15734 | "\x12\x56\x5c\x53\x96\xb6\x00\x7d" | ||
15735 | "\x90\x48\xfc\xf5\x8d\x29\x39\xcc" | ||
15736 | "\x8a\xd5\x35\x18\x36\x23\x4e\xd7" | ||
15737 | "\x76\xd1\xda\x0c\x94\x67\xbb\x04" | ||
15738 | "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea" | ||
15739 | "\x22\x64\x47\xaa\x8f\x75\x13\xbf" | ||
15740 | "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a" | ||
15741 | "\x71\x63\x2e\x89\x7b\x1e\x12\xca" | ||
15742 | "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a" | ||
15743 | "\xd6\xf9\x21\x31\x62\x44\x45\xa6" | ||
15744 | "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc" | ||
15745 | "\x9d\xde\xa5\x70\xe9\x42\x45\x8a" | ||
15746 | "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19" | ||
15747 | "\x67\x6d\xb1\xf5\xb8\x10\xdc\xc6" | ||
15748 | "\x75\x86\x96\x6b\xb1\xc5\xe4\xcf" | ||
15749 | "\xd1\x60\x91\xb3", | ||
15750 | .rlen = 128 + 20, | ||
15751 | }, | ||
15752 | }; | ||
15753 | |||
15754 | #define HMAC_SHA224_DES3_EDE_CBC_ENC_TEST_VEC 1 | ||
15755 | |||
15756 | static struct aead_testvec hmac_sha224_des3_ede_cbc_enc_tv_temp[] = { | ||
15757 | { /*Generated with cryptopp*/ | ||
15758 | #ifdef __LITTLE_ENDIAN | ||
15759 | .key = "\x08\x00" /* rta length */ | ||
15760 | "\x01\x00" /* rta type */ | ||
15761 | #else | ||
15762 | .key = "\x00\x08" /* rta length */ | ||
15763 | "\x00\x01" /* rta type */ | ||
15764 | #endif | ||
15765 | "\x00\x00\x00\x18" /* enc key length */ | ||
15766 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15767 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15768 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15769 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24" | ||
15770 | "\x44\x4D\x99\x5A\x12\xD6\x40\xC0" | ||
15771 | "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8", | ||
15772 | .klen = 8 + 24 + 24, | ||
15773 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15774 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15775 | .alen = 8, | ||
15776 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15777 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15778 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15779 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15780 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15781 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15782 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15783 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15784 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15785 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15786 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15787 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15788 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15789 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15790 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15791 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15792 | .ilen = 128, | ||
15793 | .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4" | ||
15794 | "\x67\x17\x21\xc7\x6e\x8a\xd5\x49" | ||
15795 | "\x74\xb3\x49\x05\xc5\x1c\xd0\xed" | ||
15796 | "\x12\x56\x5c\x53\x96\xb6\x00\x7d" | ||
15797 | "\x90\x48\xfc\xf5\x8d\x29\x39\xcc" | ||
15798 | "\x8a\xd5\x35\x18\x36\x23\x4e\xd7" | ||
15799 | "\x76\xd1\xda\x0c\x94\x67\xbb\x04" | ||
15800 | "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea" | ||
15801 | "\x22\x64\x47\xaa\x8f\x75\x13\xbf" | ||
15802 | "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a" | ||
15803 | "\x71\x63\x2e\x89\x7b\x1e\x12\xca" | ||
15804 | "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a" | ||
15805 | "\xd6\xf9\x21\x31\x62\x44\x45\xa6" | ||
15806 | "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc" | ||
15807 | "\x9d\xde\xa5\x70\xe9\x42\x45\x8a" | ||
15808 | "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19" | ||
15809 | "\x15\x24\x7f\x5a\x45\x4a\x66\xce" | ||
15810 | "\x2b\x0b\x93\x99\x2f\x9d\x0c\x6c" | ||
15811 | "\x56\x1f\xe1\xa6\x41\xb2\x4c\xd0", | ||
15812 | .rlen = 128 + 24, | ||
15813 | }, | ||
15814 | }; | ||
15815 | |||
15816 | #define HMAC_SHA256_DES3_EDE_CBC_ENC_TEST_VEC 1 | ||
15817 | |||
15818 | static struct aead_testvec hmac_sha256_des3_ede_cbc_enc_tv_temp[] = { | ||
15819 | { /*Generated with cryptopp*/ | ||
15820 | #ifdef __LITTLE_ENDIAN | ||
15821 | .key = "\x08\x00" /* rta length */ | ||
15822 | "\x01\x00" /* rta type */ | ||
15823 | #else | ||
15824 | .key = "\x00\x08" /* rta length */ | ||
15825 | "\x00\x01" /* rta type */ | ||
15826 | #endif | ||
15827 | "\x00\x00\x00\x18" /* enc key length */ | ||
15828 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15829 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15830 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15831 | "\xaa\xbb\xcc\xdd\xee\xff\x11\x22" | ||
15832 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24" | ||
15833 | "\x44\x4D\x99\x5A\x12\xD6\x40\xC0" | ||
15834 | "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8", | ||
15835 | .klen = 8 + 32 + 24, | ||
15836 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15837 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15838 | .alen = 8, | ||
15839 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15840 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15841 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15842 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15843 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15844 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15845 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15846 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15847 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15848 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15849 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15850 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15851 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15852 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15853 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15854 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15855 | .ilen = 128, | ||
15856 | .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4" | ||
15857 | "\x67\x17\x21\xc7\x6e\x8a\xd5\x49" | ||
15858 | "\x74\xb3\x49\x05\xc5\x1c\xd0\xed" | ||
15859 | "\x12\x56\x5c\x53\x96\xb6\x00\x7d" | ||
15860 | "\x90\x48\xfc\xf5\x8d\x29\x39\xcc" | ||
15861 | "\x8a\xd5\x35\x18\x36\x23\x4e\xd7" | ||
15862 | "\x76\xd1\xda\x0c\x94\x67\xbb\x04" | ||
15863 | "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea" | ||
15864 | "\x22\x64\x47\xaa\x8f\x75\x13\xbf" | ||
15865 | "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a" | ||
15866 | "\x71\x63\x2e\x89\x7b\x1e\x12\xca" | ||
15867 | "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a" | ||
15868 | "\xd6\xf9\x21\x31\x62\x44\x45\xa6" | ||
15869 | "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc" | ||
15870 | "\x9d\xde\xa5\x70\xe9\x42\x45\x8a" | ||
15871 | "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19" | ||
15872 | "\x73\xb0\xea\x9f\xe8\x18\x80\xd6" | ||
15873 | "\x56\x38\x44\xc0\xdb\xe3\x4f\x71" | ||
15874 | "\xf7\xce\xd1\xd3\xf8\xbd\x3e\x4f" | ||
15875 | "\xca\x43\x95\xdf\x80\x61\x81\xa9", | ||
15876 | .rlen = 128 + 32, | ||
15877 | }, | ||
15878 | }; | ||
15879 | |||
15880 | #define HMAC_SHA384_DES3_EDE_CBC_ENC_TEST_VEC 1 | ||
15881 | |||
15882 | static struct aead_testvec hmac_sha384_des3_ede_cbc_enc_tv_temp[] = { | ||
15883 | { /*Generated with cryptopp*/ | ||
15884 | #ifdef __LITTLE_ENDIAN | ||
15885 | .key = "\x08\x00" /* rta length */ | ||
15886 | "\x01\x00" /* rta type */ | ||
15887 | #else | ||
15888 | .key = "\x00\x08" /* rta length */ | ||
15889 | "\x00\x01" /* rta type */ | ||
15890 | #endif | ||
15891 | "\x00\x00\x00\x18" /* enc key length */ | ||
15892 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15893 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15894 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15895 | "\xaa\xbb\xcc\xdd\xee\xff\x11\x22" | ||
15896 | "\x33\x44\x55\x66\x77\x88\x99\xaa" | ||
15897 | "\xbb\xcc\xdd\xee\xff\x11\x22\x33" | ||
15898 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24" | ||
15899 | "\x44\x4D\x99\x5A\x12\xD6\x40\xC0" | ||
15900 | "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8", | ||
15901 | .klen = 8 + 48 + 24, | ||
15902 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15903 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15904 | .alen = 8, | ||
15905 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15906 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15907 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15908 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15909 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15910 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15911 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15912 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15913 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15914 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15915 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15916 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15917 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15918 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15919 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15920 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15921 | .ilen = 128, | ||
15922 | .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4" | ||
15923 | "\x67\x17\x21\xc7\x6e\x8a\xd5\x49" | ||
15924 | "\x74\xb3\x49\x05\xc5\x1c\xd0\xed" | ||
15925 | "\x12\x56\x5c\x53\x96\xb6\x00\x7d" | ||
15926 | "\x90\x48\xfc\xf5\x8d\x29\x39\xcc" | ||
15927 | "\x8a\xd5\x35\x18\x36\x23\x4e\xd7" | ||
15928 | "\x76\xd1\xda\x0c\x94\x67\xbb\x04" | ||
15929 | "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea" | ||
15930 | "\x22\x64\x47\xaa\x8f\x75\x13\xbf" | ||
15931 | "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a" | ||
15932 | "\x71\x63\x2e\x89\x7b\x1e\x12\xca" | ||
15933 | "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a" | ||
15934 | "\xd6\xf9\x21\x31\x62\x44\x45\xa6" | ||
15935 | "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc" | ||
15936 | "\x9d\xde\xa5\x70\xe9\x42\x45\x8a" | ||
15937 | "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19" | ||
15938 | "\x6d\x77\xfc\x80\x9d\x8a\x9c\xb7" | ||
15939 | "\x70\xe7\x93\xbf\x73\xe6\x9f\x83" | ||
15940 | "\x99\x62\x23\xe6\x5b\xd0\xda\x18" | ||
15941 | "\xa4\x32\x8a\x0b\x46\xd7\xf0\x39" | ||
15942 | "\x36\x5d\x13\x2f\x86\x10\x78\xd6" | ||
15943 | "\xd6\xbe\x5c\xb9\x15\x89\xf9\x1b", | ||
15944 | .rlen = 128 + 48, | ||
15945 | }, | ||
15946 | }; | ||
15947 | |||
15948 | #define HMAC_SHA512_DES3_EDE_CBC_ENC_TEST_VEC 1 | ||
15949 | |||
15950 | static struct aead_testvec hmac_sha512_des3_ede_cbc_enc_tv_temp[] = { | ||
15951 | { /*Generated with cryptopp*/ | ||
15952 | #ifdef __LITTLE_ENDIAN | ||
15953 | .key = "\x08\x00" /* rta length */ | ||
15954 | "\x01\x00" /* rta type */ | ||
15955 | #else | ||
15956 | .key = "\x00\x08" /* rta length */ | ||
15957 | "\x00\x01" /* rta type */ | ||
15958 | #endif | ||
15959 | "\x00\x00\x00\x18" /* enc key length */ | ||
15960 | "\x11\x22\x33\x44\x55\x66\x77\x88" | ||
15961 | "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" | ||
15962 | "\x22\x33\x44\x55\x66\x77\x88\x99" | ||
15963 | "\xaa\xbb\xcc\xdd\xee\xff\x11\x22" | ||
15964 | "\x33\x44\x55\x66\x77\x88\x99\xaa" | ||
15965 | "\xbb\xcc\xdd\xee\xff\x11\x22\x33" | ||
15966 | "\x44\x55\x66\x77\x88\x99\xaa\xbb" | ||
15967 | "\xcc\xdd\xee\xff\x11\x22\x33\x44" | ||
15968 | "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24" | ||
15969 | "\x44\x4D\x99\x5A\x12\xD6\x40\xC0" | ||
15970 | "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8", | ||
15971 | .klen = 8 + 64 + 24, | ||
15972 | .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42", | ||
15973 | .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01", | ||
15974 | .alen = 8, | ||
15975 | .input = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e" | ||
15976 | "\x53\x20\x63\x65\x65\x72\x73\x74" | ||
15977 | "\x54\x20\x6f\x6f\x4d\x20\x6e\x61" | ||
15978 | "\x20\x79\x65\x53\x72\x63\x74\x65" | ||
15979 | "\x20\x73\x6f\x54\x20\x6f\x61\x4d" | ||
15980 | "\x79\x6e\x53\x20\x63\x65\x65\x72" | ||
15981 | "\x73\x74\x54\x20\x6f\x6f\x4d\x20" | ||
15982 | "\x6e\x61\x20\x79\x65\x53\x72\x63" | ||
15983 | "\x74\x65\x20\x73\x6f\x54\x20\x6f" | ||
15984 | "\x61\x4d\x79\x6e\x53\x20\x63\x65" | ||
15985 | "\x65\x72\x73\x74\x54\x20\x6f\x6f" | ||
15986 | "\x4d\x20\x6e\x61\x20\x79\x65\x53" | ||
15987 | "\x72\x63\x74\x65\x20\x73\x6f\x54" | ||
15988 | "\x20\x6f\x61\x4d\x79\x6e\x53\x20" | ||
15989 | "\x63\x65\x65\x72\x73\x74\x54\x20" | ||
15990 | "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79", | ||
15991 | .ilen = 128, | ||
15992 | .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4" | ||
15993 | "\x67\x17\x21\xc7\x6e\x8a\xd5\x49" | ||
15994 | "\x74\xb3\x49\x05\xc5\x1c\xd0\xed" | ||
15995 | "\x12\x56\x5c\x53\x96\xb6\x00\x7d" | ||
15996 | "\x90\x48\xfc\xf5\x8d\x29\x39\xcc" | ||
15997 | "\x8a\xd5\x35\x18\x36\x23\x4e\xd7" | ||
15998 | "\x76\xd1\xda\x0c\x94\x67\xbb\x04" | ||
15999 | "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea" | ||
16000 | "\x22\x64\x47\xaa\x8f\x75\x13\xbf" | ||
16001 | "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a" | ||
16002 | "\x71\x63\x2e\x89\x7b\x1e\x12\xca" | ||
16003 | "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a" | ||
16004 | "\xd6\xf9\x21\x31\x62\x44\x45\xa6" | ||
16005 | "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc" | ||
16006 | "\x9d\xde\xa5\x70\xe9\x42\x45\x8a" | ||
16007 | "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19" | ||
16008 | "\x41\xb5\x1f\xbb\xbd\x4e\xb8\x32" | ||
16009 | "\x22\x86\x4e\x57\x1b\x2a\xd8\x6e" | ||
16010 | "\xa9\xfb\xc8\xf3\xbf\x2d\xae\x2b" | ||
16011 | "\x3b\xbc\x41\xe8\x38\xbb\xf1\x60" | ||
16012 | "\x4c\x68\xa9\x4e\x8c\x73\xa7\xc0" | ||
16013 | "\x2a\x74\xd4\x65\x12\xcb\x55\xf2" | ||
16014 | "\xd5\x02\x6d\xe6\xaf\xc9\x2f\xf2" | ||
16015 | "\x57\xaa\x85\xf7\xf3\x6a\xcb\xdb", | ||
16016 | .rlen = 128 + 64, | ||
16017 | }, | ||
16018 | }; | ||
16019 | |||
14641 | static struct cipher_testvec aes_lrw_enc_tv_template[] = { | 16020 | static struct cipher_testvec aes_lrw_enc_tv_template[] = { |
14642 | /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */ | 16021 | /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */ |
14643 | { /* LRW-32-AES 1 */ | 16022 | { /* LRW-32-AES 1 */ |
@@ -18746,7 +20125,29 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = { | |||
18746 | "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6" | 20125 | "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6" |
18747 | "\xba", | 20126 | "\xba", |
18748 | .rlen = 33, | 20127 | .rlen = 33, |
18749 | }, | 20128 | }, { |
20129 | /* | ||
20130 | * This is the same vector as aes_ccm_rfc4309_enc_tv_template[0] | ||
20131 | * below but rewritten to use the ccm algorithm directly. | ||
20132 | */ | ||
20133 | .key = "\x83\xac\x54\x66\xc2\xeb\xe5\x05" | ||
20134 | "\x2e\x01\xd1\xfc\x5d\x82\x66\x2e", | ||
20135 | .klen = 16, | ||
20136 | .iv = "\x03\x96\xac\x59\x30\x07\xa1\xe2\xa2\xc7\x55\x24\0\0\0\0", | ||
20137 | .alen = 0, | ||
20138 | .input = "\x19\xc8\x81\xf6\xe9\x86\xff\x93" | ||
20139 | "\x0b\x78\x67\xe5\xbb\xb7\xfc\x6e" | ||
20140 | "\x83\x77\xb3\xa6\x0c\x8c\x9f\x9c" | ||
20141 | "\x35\x2e\xad\xe0\x62\xf9\x91\xa1", | ||
20142 | .ilen = 32, | ||
20143 | .result = "\xab\x6f\xe1\x69\x1d\x19\x99\xa8" | ||
20144 | "\x92\xa0\xc4\x6f\x7e\xe2\x8b\xb1" | ||
20145 | "\x70\xbb\x8c\xa6\x4c\x6e\x97\x8a" | ||
20146 | "\x57\x2b\xbe\x5d\x98\xa6\xb1\x32" | ||
20147 | "\xda\x24\xea\xd9\xa1\x39\x98\xfd" | ||
20148 | "\xa4\xbe\xd9\xf2\x1a\x6d\x22\xa8", | ||
20149 | .rlen = 48, | ||
20150 | } | ||
18750 | }; | 20151 | }; |
18751 | 20152 | ||
18752 | static struct aead_testvec aes_ccm_dec_tv_template[] = { | 20153 | static struct aead_testvec aes_ccm_dec_tv_template[] = { |