qcrypto_fips.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. /* FIPS Known answer tests for Qcrypto.
  2. *
  3. * Copyright (c) 2014, The Linux Foundation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 and
  7. * only version 2 as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef __CRYPTO_MSM_QCRYPTO_FIPS_H
  15. #define __CRYPTO_MSM_QCRYPTO_FIPS_H
  16. struct _fips_completion {
  17. struct completion completion;
  18. int err;
  19. };
  20. /*
  21. * For cipher algorithms.
  22. */
  23. struct _fips_test_vector_cipher {
  24. char *key;
  25. unsigned char klen;
  26. char iv[16];
  27. unsigned char ivlen;
  28. char *pln_txt;
  29. unsigned int pln_txt_len;
  30. char *enc_txt;
  31. unsigned int enc_txt_len;
  32. char mod_alg[CRYPTO_MAX_ALG_NAME];
  33. };
  34. /*
  35. * For Hashing / HMAC algorithms.
  36. */
  37. struct _fips_test_vector_sha_hmac {
  38. char *key;
  39. unsigned char klen;
  40. char *input;
  41. unsigned char ilen;
  42. char *digest;
  43. unsigned char diglen;
  44. char hash_alg[CRYPTO_MAX_ALG_NAME];
  45. };
  46. /*
  47. *For AEAD algorithms
  48. */
  49. struct _fips_test_vector_aead {
  50. char *key;
  51. unsigned char klen;
  52. char iv[16];
  53. unsigned char ivlen;
  54. char assoc[32];
  55. unsigned char alen;
  56. char *pln_txt;
  57. unsigned int pln_txt_len;
  58. char *enc_txt;
  59. unsigned int enc_txt_len;
  60. char mod_alg[CRYPTO_MAX_ALG_NAME];
  61. };
  62. /*
  63. *Test vectors for sha/hmac tests
  64. */
  65. static struct _fips_test_vector_sha_hmac fips_test_vector_sha_hmac[] = {
  66. /*http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA1.pdf*/
  67. { /* SHA1 */
  68. .hash_alg = "sha1",
  69. .klen = 0,
  70. .input = "abc",
  71. .ilen = 3,
  72. .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a"
  73. "\xba\x3e\x25\x71\x78\x50\xc2\x6c"
  74. "\x9c\xd0\xd8\x9d",
  75. .diglen = SHA1_DIGEST_SIZE,
  76. },
  77. /* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA256.pdf */
  78. {/* SHA256 */
  79. .hash_alg = "sha256",
  80. .klen = 0,
  81. .input = "abc",
  82. .ilen = 3,
  83. .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
  84. "\x41\x41\x40\xde\x5d\xae\x22\x23"
  85. "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
  86. "\xb4\x10\xff\x61\xf2\x00\x15\xad",
  87. .diglen = SHA256_DIGEST_SIZE,
  88. },
  89. /* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/HMAC_SHA1.pdf */
  90. {/* HMAC-SHA1 */
  91. .hash_alg = "hmac(sha1)",
  92. .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
  93. "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
  94. "\x10\x11\x12\x13",
  95. .klen = 20,
  96. .input = "Sample message for keylen<blocklen",
  97. .ilen = 34,
  98. .digest = "\x4C\x99\xFF\x0C\xB1\xB3\x1B\xD3"
  99. "\x3F\x84\x31\xDB\xAF\x4D\x17\xFC"
  100. "\xD3\x56\xA8\x07",
  101. .diglen = SHA1_DIGEST_SIZE,
  102. },
  103. /* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/HMAC_SHA256.pdf */
  104. {/* HMAC-SHA256 */
  105. .hash_alg = "hmac(sha256)",
  106. .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
  107. "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
  108. "\x10\x11\x12\x13\x14\x15\x16\x17"
  109. "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
  110. "\x20\x21\x22\x23\x24\x25\x26\x27"
  111. "\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F"
  112. "\x30\x31\x32\x33\x34\x35\x36\x37"
  113. "\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F",
  114. .klen = 64,
  115. .input = "Sample message for keylen=blocklen",
  116. .ilen = 34,
  117. .digest = "\x8B\xB9\xA1\xDB\x98\x06\xF2\x0D"
  118. "\xF7\xF7\x7B\x82\x13\x8C\x79\x14"
  119. "\xD1\x74\xD5\x9E\x13\xDC\x4D\x01"
  120. "\x69\xC9\x05\x7B\x13\x3E\x1D\x62",
  121. .diglen = SHA256_DIGEST_SIZE,
  122. },
  123. };
  124. /*
  125. *Test vectors For cipher algorithms
  126. */
  127. static struct _fips_test_vector_cipher fips_test_vector_cipher[] = {
  128. /* From NIST Special Publication 800-38A, Appendix F.1 */
  129. {/* AES-128 ECB */
  130. .mod_alg = "ecb(aes)",
  131. .key = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
  132. "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
  133. .klen = 16,
  134. .ivlen = 0,
  135. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  136. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  137. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  138. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  139. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  140. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  141. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  142. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  143. .pln_txt_len = 64,
  144. .enc_txt = "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60"
  145. "\xa8\x9e\xca\xf3\x24\x66\xef\x97"
  146. "\xf5\xd3\xd5\x85\x03\xb9\x69\x9d"
  147. "\xe7\x85\x89\x5a\x96\xfd\xba\xaf"
  148. "\x43\xb1\xcd\x7f\x59\x8e\xce\x23"
  149. "\x88\x1b\x00\xe3\xed\x03\x06\x88"
  150. "\x7b\x0c\x78\x5e\x27\xe8\xad\x3f"
  151. "\x82\x23\x20\x71\x04\x72\x5d\xd4",
  152. .enc_txt_len = 64,
  153. },
  154. /* From NIST Special Publication 800-38A, Appendix F.1 */
  155. {/* AES-256 ECB */
  156. .mod_alg = "ecb(aes)",
  157. .key = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
  158. "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
  159. "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
  160. "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
  161. .klen = 32,
  162. .ivlen = 0,
  163. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  164. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  165. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  166. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  167. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  168. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  169. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  170. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  171. .pln_txt_len = 64,
  172. .enc_txt = "\xf3\xee\xd1\xbd\xb5\xd2\xa0\x3c"
  173. "\x06\x4b\x5a\x7e\x3d\xb1\x81\xf8"
  174. "\x59\x1c\xcb\x10\xd4\x10\xed\x26"
  175. "\xdc\x5b\xa7\x4a\x31\x36\x28\x70"
  176. "\xb6\xed\x21\xb9\x9c\xa6\xf4\xf9"
  177. "\xf1\x53\xe7\xb1\xbe\xaf\xed\x1d"
  178. "\x23\x30\x4b\x7a\x39\xf9\xf3\xff"
  179. "\x06\x7d\x8d\x8f\x9e\x24\xec\xc7",
  180. .enc_txt_len = 64,
  181. },
  182. /* From NIST Special Publication 800-38A, Appendix F.2 */
  183. {/* AES-128 CBC */
  184. .mod_alg = "cbc(aes)",
  185. .key = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
  186. "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
  187. .klen = 16,
  188. .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
  189. "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
  190. .ivlen = 16,
  191. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  192. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  193. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  194. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  195. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  196. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  197. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  198. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  199. .pln_txt_len = 64,
  200. .enc_txt = "\x76\x49\xab\xac\x81\x19\xb2\x46"
  201. "\xce\xe9\x8e\x9b\x12\xe9\x19\x7d"
  202. "\x50\x86\xcb\x9b\x50\x72\x19\xee"
  203. "\x95\xdb\x11\x3a\x91\x76\x78\xb2"
  204. "\x73\xbe\xd6\xb8\xe3\xc1\x74\x3b"
  205. "\x71\x16\xe6\x9e\x22\x22\x95\x16"
  206. "\x3f\xf1\xca\xa1\x68\x1f\xac\x09"
  207. "\x12\x0e\xca\x30\x75\x86\xe1\xa7",
  208. .enc_txt_len = 64,
  209. },
  210. /* From NIST Special Publication 800-38A, Appendix F.2 */
  211. {/* AES-256 CBC */
  212. .mod_alg = "cbc(aes)",
  213. .key = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
  214. "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
  215. "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
  216. "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
  217. .klen = 32,
  218. .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
  219. "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
  220. .ivlen = 16,
  221. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  222. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  223. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  224. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  225. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  226. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  227. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  228. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  229. .pln_txt_len = 64,
  230. .enc_txt = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
  231. "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
  232. "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
  233. "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
  234. "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
  235. "\xa5\x30\xe2\x63\x04\x23\x14\x61"
  236. "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
  237. "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
  238. .enc_txt_len = 64,
  239. },
  240. /* From NIST Special Publication 800-38A, Appendix F.5 */
  241. {/* AES-128 CTR */
  242. .mod_alg = "ctr(aes)",
  243. .key = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
  244. "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
  245. .klen = 16,
  246. .iv = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
  247. "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
  248. .ivlen = 16,
  249. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  250. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  251. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  252. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  253. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  254. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  255. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  256. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  257. .pln_txt_len = 64,
  258. .enc_txt = "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
  259. "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
  260. "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
  261. "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
  262. "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
  263. "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
  264. "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
  265. "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
  266. .enc_txt_len = 64,
  267. },
  268. /* From NIST Special Publication 800-38A, Appendix F.5 */
  269. {/* AES-256 CTR */
  270. .mod_alg = "ctr(aes)",
  271. .key = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
  272. "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
  273. "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
  274. "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
  275. .klen = 32,
  276. .iv = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
  277. "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
  278. .ivlen = 16,
  279. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  280. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  281. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  282. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  283. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  284. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  285. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  286. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  287. .pln_txt_len = 64,
  288. .enc_txt = "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
  289. "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
  290. "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
  291. "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
  292. "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
  293. "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
  294. "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
  295. "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
  296. .enc_txt_len = 64,
  297. },
  298. /* Derived From From NIST Special Publication 800-38A */
  299. {/* AES-128 XTS requires 2 keys and thus length of key is twice. */
  300. .mod_alg = "xts(aes)",
  301. .key = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
  302. "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
  303. "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
  304. "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
  305. .klen = 32,
  306. .iv = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
  307. "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
  308. .ivlen = 16,
  309. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  310. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  311. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  312. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  313. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  314. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  315. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  316. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  317. .pln_txt_len = 64,
  318. .enc_txt = "\xba\x2a\x7d\x50\x7b\x60\x63\x3e"
  319. "\xf3\x1b\x06\x14\xb4\x45\xb5\xb5"
  320. "\x42\x0d\x12\x57\x28\x15\x2e\x5d"
  321. "\x5a\x54\xbe\x46\x5c\x9d\x1f\x2e"
  322. "\x18\x8e\x79\x07\xc7\xdf\xe7\xf8"
  323. "\x78\xa6\x53\x2a\x80\xb4\xd9\xce"
  324. "\x1d\xbe\x75\x7e\xb6\x11\xef\x1e"
  325. "\x51\x5d\xd6\x70\x03\x51\xcc\x94",
  326. .enc_txt_len = 64,
  327. },
  328. /* Derived From From NIST Special Publication 800-38A */
  329. {/* AES-256 XTS requires 2 keys and thus length of key is twice */
  330. .mod_alg = "xts(aes)",
  331. .key = "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60"
  332. "\xa8\x9e\xca\xf3\x24\x66\xef\x97"
  333. "\xf5\xd3\xd5\x85\x03\xb9\x69\x9d"
  334. "\xe7\x85\x89\x5a\x96\xfd\xba\xaf"
  335. "\x43\xb1\xcd\x7f\x59\x8e\xce\x23"
  336. "\x88\x1b\x00\xe3\xed\x03\x06\x88"
  337. "\x7b\x0c\x78\x5e\x27\xe8\xad\x3f"
  338. "\x82\x23\x20\x71\x04\x72\x5d\xd4",
  339. .klen = 64,
  340. .iv = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
  341. "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
  342. .ivlen = 16,
  343. .pln_txt = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
  344. "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
  345. "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
  346. "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
  347. "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
  348. "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
  349. "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
  350. "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
  351. .pln_txt_len = 64,
  352. .enc_txt = "\xd7\x2b\x90\x02\x6f\xf0\xd2\x39"
  353. "\x7b\x1a\x57\x92\xd0\x1e\xc1\xb6"
  354. "\x04\x8c\x08\x8e\xa4\x1f\xa0\x0f"
  355. "\x5e\xd8\xaf\xda\x6e\xd2\x4e\x5b"
  356. "\x23\xde\x09\xa4\x19\x79\xda\xd4"
  357. "\xe9\x4b\xbc\x05\x2e\xca\x20\x7d"
  358. "\xd5\x0f\x89\x88\xa3\xda\x46\x1f"
  359. "\x1e\xde\x53\x78\x90\xb2\x9a\x2c",
  360. .enc_txt_len = 64,
  361. },
  362. /* From NIST Special Publication 800-67, Appendix B.1 */
  363. {/* 3DES ECB */
  364. .mod_alg = "ecb(des3_ede)",
  365. .key = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
  366. "\x23\x45\x67\x89\xAB\xCD\xEF\x01"
  367. "\x45\x67\x89\xAB\xCD\xEF\x01\x23",
  368. .klen = 24,
  369. .ivlen = 0,
  370. .pln_txt = "\x54\x68\x65\x20\x71\x75\x66\x63"
  371. "\x6B\x20\x62\x72\x6F\x77\x6E\x20"
  372. "\x66\x6F\x78\x20\x6A\x75\x6D\x70",
  373. .pln_txt_len = 24,
  374. .enc_txt = "\xA8\x26\xFD\x8C\xE5\x3B\x85\x5F"
  375. "\xCC\xE2\x1C\x81\x12\x25\x6F\xE6"
  376. "\x68\xD5\xC0\x5D\xD9\xB6\xB9\x00",
  377. .enc_txt_len = 24,
  378. },
  379. /* Derived From From NIST Special Publication 800-38A and 800-67 */
  380. {/* 3DES CBC */
  381. .mod_alg = "cbc(des3_ede)",
  382. .key = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
  383. "\x23\x45\x67\x89\xAB\xCD\xEF\x01"
  384. "\x45\x67\x89\xAB\xCD\xEF\x01\x23",
  385. .klen = 24,
  386. .iv = "\x00\x01\x02\x03\x04\x05\x06\x07",
  387. .ivlen = 8,
  388. .pln_txt = "\x54\x68\x65\x20\x71\x75\x66\x63"
  389. "\x6B\x20\x62\x72\x6F\x77\x6E\x20"
  390. "\x66\x6F\x78\x20\x6A\x75\x6D\x70",
  391. .pln_txt_len = 24,
  392. .enc_txt = "\xf3\x68\xd0\x6f\x3b\xbd\x61\x4e"
  393. "\x60\xf2\xd0\x24\x5c\xad\x3f\x81"
  394. "\x8d\x5c\x69\xf2\xcb\x3f\xd5\xc7",
  395. .enc_txt_len = 24,
  396. },
  397. };
  398. /*
  399. *Test vectors For AEAD algorithms
  400. */
  401. static struct _fips_test_vector_aead fips_test_vector_aead[] = {
  402. /* From NIST Special Publication 800-38C: Appendix C.1 */
  403. { /*AES 128-CCM */
  404. .mod_alg = "ccm(aes)",
  405. .key = "\x40\x41\x42\x43\x44\x45\x46\x47"
  406. "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
  407. .klen = 16,
  408. .iv = "\x07\x10\x11\x12\x13\x14\x15\x16"
  409. "\x00\x00\x00\x00\x00\x00\x00\x00",
  410. .ivlen = 16,
  411. .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07",
  412. .alen = 8,
  413. .pln_txt = "\x20\x21\x22\x23",
  414. .pln_txt_len = 4,
  415. .enc_txt = "\x71\x62\x01\x5b\x4d\xac\x25\x5d",
  416. .enc_txt_len = 8,
  417. },
  418. /* Derived From NIST Special Publication 800-38C: Appendix C.1 */
  419. { /*AES 256-CCM */
  420. .mod_alg = "ccm(aes)",
  421. .key = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
  422. "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
  423. "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
  424. "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
  425. .klen = 32,
  426. .iv = "\x07\x10\x11\x12\x13\x14\x15\x16"
  427. "\x00\x00\x00\x00\x00\x00\x00\x00",
  428. .ivlen = 16,
  429. .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07",
  430. .alen = 8,
  431. .pln_txt = "\x20\x21\x22\x23",
  432. .pln_txt_len = 4,
  433. .enc_txt = "\xa8\xc7\xa9\x6a\x3a\x5b\x15\xe1",
  434. .enc_txt_len = 8,
  435. },
  436. };
  437. #endif /* __CRYPTO_MSM_QCRYPTO_FIPS_H */