Lines Matching full:0
80 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5,
81 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
82 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0,
83 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
84 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC,
85 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
86 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A,
87 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
88 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0,
89 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
90 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B,
91 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
92 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85,
93 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
94 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5,
95 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
96 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17,
97 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
98 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88,
99 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
100 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C,
101 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
102 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9,
103 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
104 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6,
105 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
106 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E,
107 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
108 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94,
109 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
110 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68,
111 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
120 V(0D, F2, F2, FF), V(BD, 6B, 6B, D6), V(B1, 6F, 6F, DE), V(54, C5, C5, 91), \
124 V(15, FA, FA, EF), V(EB, 59, 59, B2), V(C9, 47, 47, 8E), V(0B, F0, F0, FB), \
131 V(0C, 04, 04, 08), V(52, C7, C7, 95), V(65, 23, 23, 46), V(5E, C3, C3, 9D), \
132 V(28, 18, 18, 30), V(A1, 96, 96, 37), V(0F, 05, 05, 0A), V(B5, 9A, 9A, 2F), \
133 V(09, 07, 07, 0E), V(36, 12, 12, 24), V(9B, 80, 80, 1B), V(3D, E2, E2, DF), \
150 V(30, 10, 10, 20), V(1A, FF, FF, E5), V(0E, F3, F3, FD), V(6D, D2, D2, BF), \
151 V(4C, CD, CD, 81), V(14, 0C, 0C, 18), V(35, 13, 13, 26), V(2F, EC, EC, C3), \
156 V(66, 22, 22, 44), V(7E, 2A, 2A, 54), V(AB, 90, 90, 3B), V(83, 88, 88, 0B), \
158 V(79, DE, DE, A7), V(E2, 5E, 5E, BC), V(1D, 0B, 0B, 16), V(76, DB, DB, AD), \
159 V(3B, E0, E0, DB), V(56, 32, 32, 64), V(4E, 3A, 3A, 74), V(1E, 0A, 0A, 14), \
160 V(DB, 49, 49, 92), V(0A, 06, 06, 0C), V(6C, 24, 24, 48), V(E4, 5C, 5C, B8), \
170 V(DD, 4B, 4B, 96), V(DC, BD, BD, 61), V(86, 8B, 8B, 0D), V(85, 8A, 8A, 0F), \
172 V(D8, 48, 48, 90), V(05, 03, 03, 06), V(01, F6, F6, F7), V(12, 0E, 0E, 1C), \
179 V(8F, 8C, 8C, 03), V(F8, A1, A1, 59), V(80, 89, 89, 09), V(17, 0D, 0D, 1A), \
181 V(C3, 41, 41, 82), V(B0, 99, 99, 29), V(77, 2D, 2D, 5A), V(11, 0F, 0F, 1E), \
184 #define V(a, b, c, d) 0x##a##b##c##d
188 #define V(a, b, c, d) 0x##b##c##d##a
192 #define V(a, b, c, d) 0x##c##d##a##b
196 #define V(a, b, c, d) 0x##d##a##b##c
207 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38,
208 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
209 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87,
210 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
211 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D,
212 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
213 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2,
214 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
215 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16,
216 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
217 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA,
218 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
219 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A,
220 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
221 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02,
222 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
223 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA,
224 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
225 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85,
226 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
227 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89,
228 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
229 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20,
230 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
231 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31,
232 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
233 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D,
234 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
235 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0,
236 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
237 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26,
238 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
250 V(49, 5A, B1, DE), V(67, 1B, BA, 25), V(98, 0E, EA, 45), V(E1, C0, FE, 5D), \
265 V(39, EC, 83, 0B), V(AA, EF, 60, 40), V(06, 9F, 71, 5E), V(51, 10, 6E, BD), \
270 V(47, 0A, 7C, A1), V(E9, 0F, 42, 7C), V(C9, 1E, 84, F8), V(00, 00, 00, 00), \
272 V(FB, FF, 0E, FD), V(56, 38, 85, 0F), V(1E, D5, AE, 3D), V(27, 39, 2D, 36), \
273 V(64, D9, 0F, 0A), V(21, A6, 5C, 68), V(D1, 54, 5B, 9B), V(3A, 2E, 36, 24), \
274 V(B1, 67, 0A, 0C), V(0F, E7, 57, 93), V(D2, 96, EE, B4), V(9E, 91, 9B, 1B), \
276 V(0A, BA, 93, E2), V(E5, 2A, A0, C0), V(43, E0, 22, 3C), V(1D, 17, 1B, 12), \
277 V(0B, 0D, 09, 0E), V(AD, C7, 8B, F2), V(B9, A8, B6, 2D), V(C8, A9, 1E, 14), \
283 V(4B, 2F, 9E, 1D), V(F3, 30, B2, DC), V(EC, 52, 86, 0D), V(D0, E3, C1, 77), \
286 V(C7, 4E, 49, 87), V(C1, D1, 38, D9), V(FE, A2, CA, 8C), V(36, 0B, D4, 98), \
288 V(E4, 9D, 3A, 2C), V(0D, 92, 78, 50), V(9B, CC, 5F, 6A), V(62, 46, 7E, 54), \
297 V(4A, 98, 04, F1), V(F7, DA, EC, 41), V(0E, 50, CD, 7F), V(2F, F6, 91, 17), \
300 V(04, EA, 5E, 9D), V(5D, 35, 8C, 01), V(73, 74, 87, FA), V(2E, 41, 0B, FB), \
302 V(8C, 61, D7, 9A), V(7A, 0C, A1, 37), V(8E, 14, F8, 59), V(89, 3C, 13, EB), \
307 V(72, C3, 1D, 16), V(0C, 25, E2, BC), V(8B, 49, 3C, 28), V(41, 95, 0D, FF), \
308 V(71, 01, A8, 39), V(DE, B3, 0C, 08), V(9C, E4, B4, D8), V(90, C1, 56, 64), \
312 #define V(a, b, c, d) 0x##a##b##c##d
316 #define V(a, b, c, d) 0x##b##c##d##a
320 #define V(a, b, c, d) 0x##c##d##a##b
324 #define V(a, b, c, d) 0x##d##a##b##c
335 0x00000001, 0x00000002, 0x00000004, 0x00000008,
336 0x00000010, 0x00000020, 0x00000040, 0x00000080,
337 0x0000001B, 0x00000036
369 #define ROTL8(x) (((x) << 8) & 0xFFFFFFFF) | ((x) >> 24)
370 #define XTIME(x) (((x) << 1) ^ (((x) & 0x80) ? 0x1B : 0x00))
371 #define MUL(x, y) (((x) && (y)) ? pow[(log[(x)]+log[(y)]) % 255] : 0)
373 MBEDTLS_MAYBE_UNUSED static int aes_init_done = 0;
385 for (i = 0, x = 1; i < 256; i++) { in aes_gen_tables()
394 for (i = 0, x = 1; i < 10; i++) { in aes_gen_tables()
402 FSb[0x00] = 0x63; in aes_gen_tables()
404 RSb[0x63] = 0x00; in aes_gen_tables()
414 x ^= y ^ 0x63; in aes_gen_tables()
425 for (i = 0; i < 256; i++) { in aes_gen_tables()
444 RT0[i] = ((uint32_t) MUL(0x0E, x)) ^ in aes_gen_tables()
445 ((uint32_t) MUL(0x09, x) << 8) ^ in aes_gen_tables()
446 ((uint32_t) MUL(0x0D, x) << 16) ^ in aes_gen_tables()
447 ((uint32_t) MUL(0x0B, x) << 24); in aes_gen_tables()
494 memset(ctx, 0, sizeof(mbedtls_aes_context)); in mbedtls_aes_init()
538 int align_16_bytes = 0; in mbedtls_aes_rk_offset()
558 unsigned delta = ((uintptr_t) buf & 0x0000000fU) / 4; in mbedtls_aes_rk_offset()
559 if (delta == 0) { in mbedtls_aes_rk_offset()
560 return 0; in mbedtls_aes_rk_offset()
569 return 0; in mbedtls_aes_rk_offset()
591 if (aes_init_done == 0) { in mbedtls_aes_setkey_enc()
613 for (unsigned int i = 0; i < (keybits >> 5); i++) { in mbedtls_aes_setkey_enc()
620 for (unsigned int i = 0; i < 10; i++, RK += 4) { in mbedtls_aes_setkey_enc()
621 RK[4] = RK[0] ^ round_constants[i] ^ in mbedtls_aes_setkey_enc()
636 for (unsigned int i = 0; i < 8; i++, RK += 6) { in mbedtls_aes_setkey_enc()
637 RK[6] = RK[0] ^ round_constants[i] ^ in mbedtls_aes_setkey_enc()
653 for (unsigned int i = 0; i < 7; i++, RK += 8) { in mbedtls_aes_setkey_enc()
654 RK[8] = RK[0] ^ round_constants[i] ^ in mbedtls_aes_setkey_enc()
678 return 0; in mbedtls_aes_setkey_enc()
704 if ((ret = mbedtls_aes_setkey_enc(&cty, key, keybits)) != 0) { in mbedtls_aes_setkey_dec()
736 for (int i = ctx->nr - 1; i > 0; i--, SK -= 8) { in mbedtls_aes_setkey_dec()
737 for (int j = 0; j < 4; j++, SK++) { in mbedtls_aes_setkey_dec()
776 *key1 = &key[0]; in mbedtls_aes_xts_decode_keys()
779 return 0; in mbedtls_aes_xts_decode_keys()
792 if (ret != 0) { in mbedtls_aes_xts_setkey_enc()
798 if (ret != 0) { in mbedtls_aes_xts_setkey_enc()
816 if (ret != 0) { in mbedtls_aes_xts_setkey_dec()
822 if (ret != 0) { in mbedtls_aes_xts_setkey_dec()
853 } while (0)
877 } while (0)
894 t.X[0] = MBEDTLS_GET_UINT32_LE(input, 0); t.X[0] ^= *RK++; in mbedtls_internal_aes_encrypt()
899 for (i = (ctx->nr >> 1) - 1; i > 0; i--) { in mbedtls_internal_aes_encrypt()
900 AES_FROUND(t.Y[0], t.Y[1], t.Y[2], t.Y[3], t.X[0], t.X[1], t.X[2], t.X[3]); in mbedtls_internal_aes_encrypt()
901 AES_FROUND(t.X[0], t.X[1], t.X[2], t.X[3], t.Y[0], t.Y[1], t.Y[2], t.Y[3]); in mbedtls_internal_aes_encrypt()
904 AES_FROUND(t.Y[0], t.Y[1], t.Y[2], t.Y[3], t.X[0], t.X[1], t.X[2], t.X[3]); in mbedtls_internal_aes_encrypt()
906 t.X[0] = *RK++ ^ \ in mbedtls_internal_aes_encrypt()
907 ((uint32_t) FSb[MBEDTLS_BYTE_0(t.Y[0])]) ^ in mbedtls_internal_aes_encrypt()
916 ((uint32_t) FSb[MBEDTLS_BYTE_3(t.Y[0])] << 24); in mbedtls_internal_aes_encrypt()
921 ((uint32_t) FSb[MBEDTLS_BYTE_2(t.Y[0])] << 16) ^ in mbedtls_internal_aes_encrypt()
926 ((uint32_t) FSb[MBEDTLS_BYTE_1(t.Y[0])] << 8) ^ in mbedtls_internal_aes_encrypt()
930 MBEDTLS_PUT_UINT32_LE(t.X[0], output, 0); in mbedtls_internal_aes_encrypt()
937 return 0; in mbedtls_internal_aes_encrypt()
956 t.X[0] = MBEDTLS_GET_UINT32_LE(input, 0); t.X[0] ^= *RK++; in mbedtls_internal_aes_decrypt()
961 for (i = (ctx->nr >> 1) - 1; i > 0; i--) { in mbedtls_internal_aes_decrypt()
962 AES_RROUND(t.Y[0], t.Y[1], t.Y[2], t.Y[3], t.X[0], t.X[1], t.X[2], t.X[3]); in mbedtls_internal_aes_decrypt()
963 AES_RROUND(t.X[0], t.X[1], t.X[2], t.X[3], t.Y[0], t.Y[1], t.Y[2], t.Y[3]); in mbedtls_internal_aes_decrypt()
966 AES_RROUND(t.Y[0], t.Y[1], t.Y[2], t.Y[3], t.X[0], t.X[1], t.X[2], t.X[3]); in mbedtls_internal_aes_decrypt()
968 t.X[0] = *RK++ ^ \ in mbedtls_internal_aes_decrypt()
969 ((uint32_t) RSb[MBEDTLS_BYTE_0(t.Y[0])]) ^ in mbedtls_internal_aes_decrypt()
976 ((uint32_t) RSb[MBEDTLS_BYTE_1(t.Y[0])] << 8) ^ in mbedtls_internal_aes_decrypt()
983 ((uint32_t) RSb[MBEDTLS_BYTE_2(t.Y[0])] << 16) ^ in mbedtls_internal_aes_decrypt()
990 ((uint32_t) RSb[MBEDTLS_BYTE_3(t.Y[0])] << 24); in mbedtls_internal_aes_decrypt()
992 MBEDTLS_PUT_UINT32_LE(t.X[0], output, 0); in mbedtls_internal_aes_decrypt()
999 return 0; in mbedtls_internal_aes_decrypt()
1050 if (aes_padlock_ace > 0) { in mbedtls_aes_crypt_ecb()
1087 if (length == 0) { in mbedtls_aes_crypt_cbc()
1088 return 0; in mbedtls_aes_crypt_cbc()
1096 if (aes_padlock_ace > 0) { in mbedtls_aes_crypt_cbc()
1097 if (mbedtls_padlock_xcryptcbc(ctx, mode, length, iv, input, output) == 0) { in mbedtls_aes_crypt_cbc()
1098 return 0; in mbedtls_aes_crypt_cbc()
1110 while (length > 0) { in mbedtls_aes_crypt_cbc()
1113 if (ret != 0) { in mbedtls_aes_crypt_cbc()
1128 while (length > 0) { in mbedtls_aes_crypt_cbc()
1132 if (ret != 0) { in mbedtls_aes_crypt_cbc()
1143 ret = 0; in mbedtls_aes_crypt_cbc()
1170 a = MBEDTLS_GET_UINT64_LE(x, 0); in mbedtls_gf128mul_x_ble()
1173 ra = (a << 1) ^ 0x0087 >> (8 - ((b >> 63) << 3)); in mbedtls_gf128mul_x_ble()
1176 MBEDTLS_PUT_UINT64_LE(ra, r, 0); in mbedtls_gf128mul_x_ble()
1220 if (ret != 0) { in mbedtls_aes_crypt_xts()
1225 if (MBEDTLS_UNLIKELY(leftover && (mode == MBEDTLS_AES_DECRYPT) && blocks == 0)) { in mbedtls_aes_crypt_xts()
1238 if (ret != 0) { in mbedtls_aes_crypt_xts()
1263 for (i = 0; i < leftover; i++) { in mbedtls_aes_crypt_xts()
1275 if (ret != 0) { in mbedtls_aes_crypt_xts()
1284 return 0; in mbedtls_aes_crypt_xts()
1316 if (n == 0) { in mbedtls_aes_crypt_cfb128()
1318 if (ret != 0) { in mbedtls_aes_crypt_cfb128()
1327 n = (n + 1) & 0x0F; in mbedtls_aes_crypt_cfb128()
1331 if (n == 0) { in mbedtls_aes_crypt_cfb128()
1333 if (ret != 0) { in mbedtls_aes_crypt_cfb128()
1340 n = (n + 1) & 0x0F; in mbedtls_aes_crypt_cfb128()
1345 ret = 0; in mbedtls_aes_crypt_cfb128()
1371 if (ret != 0) { in mbedtls_aes_crypt_cfb8()
1379 c = *output++ = (unsigned char) (iv[0] ^ *input++); in mbedtls_aes_crypt_cfb8()
1387 ret = 0; in mbedtls_aes_crypt_cfb8()
1405 int ret = 0; in mbedtls_aes_crypt_ofb()
1415 if (n == 0) { in mbedtls_aes_crypt_ofb()
1417 if (ret != 0) { in mbedtls_aes_crypt_ofb()
1423 n = (n + 1) & 0x0F; in mbedtls_aes_crypt_ofb()
1449 if (offset > 0x0F) { in mbedtls_aes_crypt_ctr()
1453 for (size_t i = 0; i < length;) { in mbedtls_aes_crypt_ctr()
1455 if (offset == 0) { in mbedtls_aes_crypt_ctr()
1457 if (ret != 0) { in mbedtls_aes_crypt_ctr()
1470 offset = 0; in mbedtls_aes_crypt_ctr()
1477 ret = 0; in mbedtls_aes_crypt_ctr()
1495 { 0x44, 0x41, 0x6A, 0xC2, 0xD1, 0xF5, 0x3C, 0x58,
1496 0x33, 0x03, 0x91, 0x7E, 0x6B, 0xE9, 0xEB, 0xE0 },
1498 { 0x48, 0xE3, 0x1E, 0x9E, 0x25, 0x67, 0x18, 0xF2,
1499 0x92, 0x29, 0x31, 0x9C, 0x19, 0xF1, 0x5B, 0xA4 },
1500 { 0x05, 0x8C, 0xCF, 0xFD, 0xBB, 0xCB, 0x38, 0x2D,
1501 0x1F, 0x6F, 0x56, 0x58, 0x5D, 0x8A, 0x4A, 0xDE }
1508 { 0xC3, 0x4C, 0x05, 0x2C, 0xC0, 0xDA, 0x8D, 0x73,
1509 0x45, 0x1A, 0xFE, 0x5F, 0x03, 0xBE, 0x29, 0x7F },
1511 { 0xF3, 0xF6, 0x75, 0x2A, 0xE8, 0xD7, 0x83, 0x11,
1512 0x38, 0xF0, 0x41, 0x56, 0x06, 0x31, 0xB1, 0x14 },
1513 { 0x8B, 0x79, 0xEE, 0xCC, 0x93, 0xA0, 0xEE, 0x5D,
1514 0xFF, 0x30, 0xB4, 0xEA, 0x21, 0x63, 0x6D, 0xA4 }
1521 { 0xFA, 0xCA, 0x37, 0xE0, 0xB0, 0xC8, 0x53, 0x73,
1522 0xDF, 0x70, 0x6E, 0x73, 0xF7, 0xC9, 0xAF, 0x86 },
1524 { 0x5D, 0xF6, 0x78, 0xDD, 0x17, 0xBA, 0x4E, 0x75,
1525 0xB6, 0x17, 0x68, 0xC6, 0xAD, 0xEF, 0x7C, 0x7B },
1526 { 0x48, 0x04, 0xE1, 0x81, 0x8F, 0xE6, 0x29, 0x75,
1527 0x19, 0xA3, 0xE8, 0x8C, 0x57, 0x31, 0x04, 0x13 }
1533 { 0x8A, 0x05, 0xFC, 0x5E, 0x09, 0x5A, 0xF4, 0x84,
1534 0x8A, 0x08, 0xD3, 0x28, 0xD3, 0x68, 0x8E, 0x3D },
1536 { 0x7B, 0xD9, 0x66, 0xD5, 0x3A, 0xD8, 0xC1, 0xBB,
1537 0x85, 0xD2, 0xAD, 0xFA, 0xE8, 0x7B, 0xB1, 0x04 },
1538 { 0xFE, 0x3C, 0x53, 0x65, 0x3E, 0x2F, 0x45, 0xB5,
1539 0x6F, 0xCD, 0x88, 0xB2, 0xCC, 0x89, 0x8F, 0xF0 }
1552 { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
1553 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C },
1555 { 0x8E, 0x73, 0xB0, 0xF7, 0xDA, 0x0E, 0x64, 0x52,
1556 0xC8, 0x10, 0xF3, 0x2B, 0x80, 0x90, 0x79, 0xE5,
1557 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C, 0x6B, 0x7B },
1558 { 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE,
1559 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81,
1560 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7,
1561 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 }
1567 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1568 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
1573 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96,
1574 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A,
1575 0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03, 0xAC, 0x9C,
1576 0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51,
1577 0x30, 0xC8, 0x1C, 0x46, 0xA3, 0x5C, 0xE4, 0x11,
1578 0xE5, 0xFB, 0xC1, 0x19, 0x1A, 0x0A, 0x52, 0xEF,
1579 0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17,
1580 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10
1585 { 0x3B, 0x3F, 0xD9, 0x2E, 0xB7, 0x2D, 0xAD, 0x20,
1586 0x33, 0x34, 0x49, 0xF8, 0xE8, 0x3C, 0xFB, 0x4A,
1587 0xC8, 0xA6, 0x45, 0x37, 0xA0, 0xB3, 0xA9, 0x3F,
1588 0xCD, 0xE3, 0xCD, 0xAD, 0x9F, 0x1C, 0xE5, 0x8B,
1589 0x26, 0x75, 0x1F, 0x67, 0xA3, 0xCB, 0xB1, 0x40,
1590 0xB1, 0x80, 0x8C, 0xF1, 0x87, 0xA4, 0xF4, 0xDF,
1591 0xC0, 0x4B, 0x05, 0x35, 0x7C, 0x5D, 0x1C, 0x0E,
1592 0xEA, 0xC4, 0xC6, 0x6F, 0x9F, 0xF7, 0xF2, 0xE6 },
1594 { 0xCD, 0xC8, 0x0D, 0x6F, 0xDD, 0xF1, 0x8C, 0xAB,
1595 0x34, 0xC2, 0x59, 0x09, 0xC9, 0x9A, 0x41, 0x74,
1596 0x67, 0xCE, 0x7F, 0x7F, 0x81, 0x17, 0x36, 0x21,
1597 0x96, 0x1A, 0x2B, 0x70, 0x17, 0x1D, 0x3D, 0x7A,
1598 0x2E, 0x1E, 0x8A, 0x1D, 0xD5, 0x9B, 0x88, 0xB1,
1599 0xC8, 0xE6, 0x0F, 0xED, 0x1E, 0xFA, 0xC4, 0xC9,
1600 0xC0, 0x5F, 0x9F, 0x9C, 0xA9, 0x83, 0x4F, 0xA0,
1601 0x42, 0xAE, 0x8F, 0xBA, 0x58, 0x4B, 0x09, 0xFF },
1602 { 0xDC, 0x7E, 0x84, 0xBF, 0xDA, 0x79, 0x16, 0x4B,
1603 0x7E, 0xCD, 0x84, 0x86, 0x98, 0x5D, 0x38, 0x60,
1604 0x39, 0xFF, 0xED, 0x14, 0x3B, 0x28, 0xB1, 0xC8,
1605 0x32, 0x11, 0x3C, 0x63, 0x31, 0xE5, 0x40, 0x7B,
1606 0xDF, 0x10, 0x13, 0x24, 0x15, 0xE5, 0x4B, 0x92,
1607 0xA1, 0x3E, 0xD0, 0xA8, 0x26, 0x7A, 0xE2, 0xF9,
1608 0x75, 0xA3, 0x85, 0x74, 0x1A, 0xB9, 0xCE, 0xF8,
1609 0x20, 0x31, 0x62, 0x3D, 0x55, 0xB1, 0xE4, 0x71 }
1622 { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
1623 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C },
1625 { 0x8E, 0x73, 0xB0, 0xF7, 0xDA, 0x0E, 0x64, 0x52,
1626 0xC8, 0x10, 0xF3, 0x2B, 0x80, 0x90, 0x79, 0xE5,
1627 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C, 0x6B, 0x7B },
1628 { 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE,
1629 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81,
1630 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7,
1631 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 }
1637 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1638 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
1643 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96,
1644 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A,
1645 0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03, 0xAC, 0x9C,
1646 0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51,
1647 0x30, 0xC8, 0x1C, 0x46, 0xA3, 0x5C, 0xE4, 0x11,
1648 0xE5, 0xFB, 0xC1, 0x19, 0x1A, 0x0A, 0x52, 0xEF,
1649 0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17,
1650 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10
1655 { 0x3B, 0x3F, 0xD9, 0x2E, 0xB7, 0x2D, 0xAD, 0x20,
1656 0x33, 0x34, 0x49, 0xF8, 0xE8, 0x3C, 0xFB, 0x4A,
1657 0x77, 0x89, 0x50, 0x8d, 0x16, 0x91, 0x8f, 0x03,
1658 0xf5, 0x3c, 0x52, 0xda, 0xc5, 0x4e, 0xd8, 0x25,
1659 0x97, 0x40, 0x05, 0x1e, 0x9c, 0x5f, 0xec, 0xf6,
1660 0x43, 0x44, 0xf7, 0xa8, 0x22, 0x60, 0xed, 0xcc,
1661 0x30, 0x4c, 0x65, 0x28, 0xf6, 0x59, 0xc7, 0x78,
1662 0x66, 0xa5, 0x10, 0xd9, 0xc1, 0xd6, 0xae, 0x5e },
1664 { 0xCD, 0xC8, 0x0D, 0x6F, 0xDD, 0xF1, 0x8C, 0xAB,
1665 0x34, 0xC2, 0x59, 0x09, 0xC9, 0x9A, 0x41, 0x74,
1666 0xfc, 0xc2, 0x8b, 0x8d, 0x4c, 0x63, 0x83, 0x7c,
1667 0x09, 0xe8, 0x17, 0x00, 0xc1, 0x10, 0x04, 0x01,
1668 0x8d, 0x9a, 0x9a, 0xea, 0xc0, 0xf6, 0x59, 0x6f,
1669 0x55, 0x9c, 0x6d, 0x4d, 0xaf, 0x59, 0xa5, 0xf2,
1670 0x6d, 0x9f, 0x20, 0x08, 0x57, 0xca, 0x6c, 0x3e,
1671 0x9c, 0xac, 0x52, 0x4b, 0xd9, 0xac, 0xc9, 0x2a },
1672 { 0xDC, 0x7E, 0x84, 0xBF, 0xDA, 0x79, 0x16, 0x4B,
1673 0x7E, 0xCD, 0x84, 0x86, 0x98, 0x5D, 0x38, 0x60,
1674 0x4f, 0xeb, 0xdc, 0x67, 0x40, 0xd2, 0x0b, 0x3a,
1675 0xc8, 0x8f, 0x6a, 0xd8, 0x2a, 0x4f, 0xb0, 0x8d,
1676 0x71, 0xab, 0x47, 0xa0, 0x86, 0xe8, 0x6e, 0xed,
1677 0xf3, 0x9d, 0x1c, 0x5b, 0xba, 0x97, 0xc4, 0x08,
1678 0x01, 0x26, 0x14, 0x1d, 0x67, 0xf3, 0x7b, 0xe8,
1679 0x53, 0x8f, 0x5a, 0x8b, 0xe7, 0x40, 0xe4, 0x84 }
1693 { 0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC,
1694 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E },
1695 { 0x7E, 0x24, 0x06, 0x78, 0x17, 0xFA, 0xE0, 0xD7,
1696 0x43, 0xD6, 0xCE, 0x1F, 0x32, 0x53, 0x91, 0x63 },
1697 { 0x76, 0x91, 0xBE, 0x03, 0x5E, 0x50, 0x20, 0xA8,
1698 0xAC, 0x6E, 0x61, 0x85, 0x29, 0xF9, 0xA0, 0xDC }
1703 { 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00,
1704 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
1705 { 0x00, 0x6C, 0xB6, 0xDB, 0xC0, 0x54, 0x3B, 0x59,
1706 0xDA, 0x48, 0xD9, 0x0B, 0x00, 0x00, 0x00, 0x01 },
1707 { 0x00, 0xE0, 0x01, 0x7B, 0x27, 0x77, 0x7F, 0x3F,
1708 0x4A, 0x17, 0x86, 0xF0, 0x00, 0x00, 0x00, 0x01 }
1713 { 0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62,
1714 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67 },
1715 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1716 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
1717 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1718 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F },
1720 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1721 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
1722 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1723 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
1724 0x20, 0x21, 0x22, 0x23 }
1729 { 0xE4, 0x09, 0x5D, 0x4F, 0xB7, 0xA7, 0xB3, 0x79,
1730 0x2D, 0x61, 0x75, 0xA3, 0x26, 0x13, 0x11, 0xB8 },
1731 { 0x51, 0x04, 0xA1, 0x06, 0x16, 0x8A, 0x72, 0xD9,
1732 0x79, 0x0D, 0x41, 0xEE, 0x8E, 0xDA, 0xD3, 0x88,
1733 0xEB, 0x2E, 0x1E, 0xFC, 0x46, 0xDA, 0x57, 0xC8,
1734 0xFC, 0xE6, 0x30, 0xDF, 0x91, 0x41, 0xBE, 0x28 },
1735 { 0xC1, 0xCF, 0x48, 0xA8, 0x9F, 0x2F, 0xFD, 0xD9,
1736 0xCF, 0x46, 0x52, 0xE9, 0xEF, 0xDB, 0x72, 0xD7,
1737 0x45, 0x40, 0xA4, 0x2B, 0xDE, 0x6D, 0x78, 0x36,
1738 0xD5, 0x9A, 0x5C, 0xEA, 0xAE, 0xF3, 0x10, 0x53,
1739 0x25, 0xB2, 0x07, 0x2F }
1756 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1757 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1758 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1759 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1760 { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1761 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1762 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
1763 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 },
1764 { 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
1765 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
1766 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
1767 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 },
1772 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1773 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1774 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1775 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1776 { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
1777 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
1778 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
1779 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 },
1780 { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
1781 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
1782 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
1783 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 },
1788 { 0x91, 0x7c, 0xf6, 0x9e, 0xbd, 0x68, 0xb2, 0xec,
1789 0x9b, 0x9f, 0xe9, 0xa3, 0xea, 0xdd, 0xa6, 0x92,
1790 0xcd, 0x43, 0xd2, 0xf5, 0x95, 0x98, 0xed, 0x85,
1791 0x8c, 0x02, 0xc2, 0x65, 0x2f, 0xbf, 0x92, 0x2e },
1792 { 0xc4, 0x54, 0x18, 0x5e, 0x6a, 0x16, 0x93, 0x6e,
1793 0x39, 0x33, 0x40, 0x38, 0xac, 0xef, 0x83, 0x8b,
1794 0xfb, 0x18, 0x6f, 0xff, 0x74, 0x80, 0xad, 0xc4,
1795 0x28, 0x93, 0x82, 0xec, 0xd6, 0xd3, 0x94, 0xf0 },
1796 { 0xaf, 0x85, 0x33, 0x6b, 0x59, 0x7a, 0xfc, 0x1a,
1797 0x90, 0x0b, 0x2e, 0xb2, 0x1e, 0xc9, 0x49, 0xd2,
1798 0x92, 0xdf, 0x4c, 0x04, 0x7e, 0x0b, 0x21, 0x53,
1799 0x21, 0x86, 0xa5, 0x97, 0x1a, 0x22, 0x7a, 0x89 },
1804 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1805 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1806 { 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00,
1807 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1808 { 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00,
1809 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1819 int ret = 0, i, j, u, mode; in mbedtls_aes_self_test()
1844 memset(key, 0, 32); in mbedtls_aes_self_test()
1847 if (verbose != 0) { in mbedtls_aes_self_test()
1888 for (i = 0; i < num_tests << 1; i++) { in mbedtls_aes_self_test()
1893 if (verbose != 0) { in mbedtls_aes_self_test()
1899 if (verbose != 0) { in mbedtls_aes_self_test()
1906 memset(buf, 0, 16); in mbedtls_aes_self_test()
1927 } else if (ret != 0) { in mbedtls_aes_self_test()
1931 for (j = 0; j < 10000; j++) { in mbedtls_aes_self_test()
1933 if (ret != 0) { in mbedtls_aes_self_test()
1938 if (memcmp(buf, aes_tests, 16) != 0) { in mbedtls_aes_self_test()
1943 if (verbose != 0) { in mbedtls_aes_self_test()
1948 if (verbose != 0) { in mbedtls_aes_self_test()
1961 for (i = 0; i < num_tests << 1; i++) { in mbedtls_aes_self_test()
1966 if (verbose != 0) { in mbedtls_aes_self_test()
1971 memset(iv, 0, 16); in mbedtls_aes_self_test()
1972 memset(prv, 0, 16); in mbedtls_aes_self_test()
1973 memset(buf, 0, 16); in mbedtls_aes_self_test()
1991 } else if (ret != 0) { in mbedtls_aes_self_test()
1995 for (j = 0; j < 10000; j++) { in mbedtls_aes_self_test()
2005 if (ret != 0) { in mbedtls_aes_self_test()
2011 if (memcmp(buf, aes_tests, 16) != 0) { in mbedtls_aes_self_test()
2016 if (verbose != 0) { in mbedtls_aes_self_test()
2021 if (verbose != 0) { in mbedtls_aes_self_test()
2035 for (i = 0; i < num_tests << 1; i++) { in mbedtls_aes_self_test()
2040 if (verbose != 0) { in mbedtls_aes_self_test()
2048 offset = 0; in mbedtls_aes_self_test()
2058 } else if (ret != 0) { in mbedtls_aes_self_test()
2071 if (ret != 0) { in mbedtls_aes_self_test()
2075 if (memcmp(buf, aes_tests, 64) != 0) { in mbedtls_aes_self_test()
2080 if (verbose != 0) { in mbedtls_aes_self_test()
2085 if (verbose != 0) { in mbedtls_aes_self_test()
2099 for (i = 0; i < num_tests << 1; i++) { in mbedtls_aes_self_test()
2104 if (verbose != 0) { in mbedtls_aes_self_test()
2112 offset = 0; in mbedtls_aes_self_test()
2122 } else if (ret != 0) { in mbedtls_aes_self_test()
2135 if (ret != 0) { in mbedtls_aes_self_test()
2139 if (memcmp(buf, aes_tests, 64) != 0) { in mbedtls_aes_self_test()
2144 if (verbose != 0) { in mbedtls_aes_self_test()
2149 if (verbose != 0) { in mbedtls_aes_self_test()
2163 for (i = 0; i < num_tests << 1; i++) { in mbedtls_aes_self_test()
2167 if (verbose != 0) { in mbedtls_aes_self_test()
2175 offset = 0; in mbedtls_aes_self_test()
2176 if ((ret = mbedtls_aes_setkey_enc(&ctx, key, 128)) != 0) { in mbedtls_aes_self_test()
2192 if (ret != 0) { in mbedtls_aes_self_test()
2196 if (memcmp(buf, aes_tests, len) != 0) { in mbedtls_aes_self_test()
2201 if (verbose != 0) { in mbedtls_aes_self_test()
2207 if (verbose != 0) { in mbedtls_aes_self_test()
2223 for (i = 0; i < num_tests << 1; i++) { in mbedtls_aes_self_test()
2228 if (verbose != 0) { in mbedtls_aes_self_test()
2233 memset(key, 0, sizeof(key)); in mbedtls_aes_self_test()
2241 if (ret != 0) { in mbedtls_aes_self_test()
2248 if (ret != 0) { in mbedtls_aes_self_test()
2258 if (ret != 0) { in mbedtls_aes_self_test()
2262 if (memcmp(buf, aes_tests, len) != 0) { in mbedtls_aes_self_test()
2267 if (verbose != 0) { in mbedtls_aes_self_test()
2272 if (verbose != 0) { in mbedtls_aes_self_test()
2280 ret = 0; in mbedtls_aes_self_test()
2283 if (ret != 0 && verbose != 0) { in mbedtls_aes_self_test()