Lines Matching refs:i
61 #define GET_UINT32_BE(n,b,i) \ argument
63 (n) = ( (uint32_t) (b)[(i) ] << 24 ) \
64 | ( (uint32_t) (b)[(i) + 1] << 16 ) \
65 | ( (uint32_t) (b)[(i) + 2] << 8 ) \
66 | ( (uint32_t) (b)[(i) + 3] ); \
71 #define PUT_UINT32_BE(n,b,i) \ argument
73 (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
74 (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
75 (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
76 (b)[(i) + 3] = (unsigned char) ( (n) ); \
103 int ret, i, j; in gcm_gen_table() local
136 for( i = 4; i > 0; i >>= 1 ) in gcm_gen_table()
142 ctx->HL[i] = vl; in gcm_gen_table()
143 ctx->HH[i] = vh; in gcm_gen_table()
146 for( i = 2; i <= 8; i *= 2 ) in gcm_gen_table()
148 uint64_t *HiL = ctx->HL + i, *HiH = ctx->HH + i; in gcm_gen_table()
151 for( j = 1; j < i; j++ ) in gcm_gen_table()
213 int i = 0; in gcm_mult() local
236 for( i = 15; i >= 0; i-- ) in gcm_mult()
238 lo = x[i] & 0xf; in gcm_mult()
239 hi = x[i] >> 4; in gcm_mult()
241 if( i != 15 ) in gcm_mult()
275 size_t i; in mbedtls_gcm_starts() local
308 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_starts()
309 ctx->y[i] ^= p[i]; in mbedtls_gcm_starts()
317 for( i = 0; i < 16; i++ ) in mbedtls_gcm_starts()
318 ctx->y[i] ^= work_buf[i]; in mbedtls_gcm_starts()
335 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_starts()
336 ctx->buf[i] ^= p[i]; in mbedtls_gcm_starts()
354 size_t i; in mbedtls_gcm_update() local
377 for( i = 16; i > 12; i-- ) in mbedtls_gcm_update()
378 if( ++ctx->y[i - 1] != 0 ) in mbedtls_gcm_update()
387 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_update()
390 ctx->buf[i] ^= p[i]; in mbedtls_gcm_update()
391 out_p[i] = ectr[i] ^ p[i]; in mbedtls_gcm_update()
393 ctx->buf[i] ^= out_p[i]; in mbedtls_gcm_update()
411 size_t i; in mbedtls_gcm_finish() local
429 for( i = 0; i < 16; i++ ) in mbedtls_gcm_finish()
430 ctx->buf[i] ^= work_buf[i]; in mbedtls_gcm_finish()
434 for( i = 0; i < tag_len; i++ ) in mbedtls_gcm_finish()
435 tag[i] ^= ctx->buf[i]; in mbedtls_gcm_finish()
480 size_t i; in mbedtls_gcm_auth_decrypt() local
491 for( diff = 0, i = 0; i < tag_len; i++ ) in mbedtls_gcm_auth_decrypt()
492 diff |= tag[i] ^ check_tag[i]; in mbedtls_gcm_auth_decrypt()
742 int i, j, ret; in mbedtls_gcm_self_test() local
751 for( i = 0; i < MAX_TESTS; i++ ) in mbedtls_gcm_self_test()
755 key_len, i, "enc" ); in mbedtls_gcm_self_test()
757 mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); in mbedtls_gcm_self_test()
760 pt_len[i], in mbedtls_gcm_self_test()
761 iv[iv_index[i]], iv_len[i], in mbedtls_gcm_self_test()
762 additional[add_index[i]], add_len[i], in mbedtls_gcm_self_test()
763 pt[pt_index[i]], buf, 16, tag_buf ); in mbedtls_gcm_self_test()
766 memcmp( buf, ct[j * 6 + i], pt_len[i] ) != 0 || in mbedtls_gcm_self_test()
767 memcmp( tag_buf, tag[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()
782 key_len, i, "dec" ); in mbedtls_gcm_self_test()
784 mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); in mbedtls_gcm_self_test()
787 pt_len[i], in mbedtls_gcm_self_test()
788 iv[iv_index[i]], iv_len[i], in mbedtls_gcm_self_test()
789 additional[add_index[i]], add_len[i], in mbedtls_gcm_self_test()
790 ct[j * 6 + i], buf, 16, tag_buf ); in mbedtls_gcm_self_test()
793 memcmp( buf, pt[pt_index[i]], pt_len[i] ) != 0 || in mbedtls_gcm_self_test()
794 memcmp( tag_buf, tag[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()
809 key_len, i, "enc" ); in mbedtls_gcm_self_test()
811 mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); in mbedtls_gcm_self_test()
814 iv[iv_index[i]], iv_len[i], in mbedtls_gcm_self_test()
815 additional[add_index[i]], add_len[i] ); in mbedtls_gcm_self_test()
824 if( pt_len[i] > 32 ) in mbedtls_gcm_self_test()
826 size_t rest_len = pt_len[i] - 32; in mbedtls_gcm_self_test()
827 ret = mbedtls_gcm_update( &ctx, 32, pt[pt_index[i]], buf ); in mbedtls_gcm_self_test()
836 ret = mbedtls_gcm_update( &ctx, rest_len, pt[pt_index[i]] + 32, in mbedtls_gcm_self_test()
848 ret = mbedtls_gcm_update( &ctx, pt_len[i], pt[pt_index[i]], buf ); in mbedtls_gcm_self_test()
860 memcmp( buf, ct[j * 6 + i], pt_len[i] ) != 0 || in mbedtls_gcm_self_test()
861 memcmp( tag_buf, tag[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()
876 key_len, i, "dec" ); in mbedtls_gcm_self_test()
878 mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); in mbedtls_gcm_self_test()
881 iv[iv_index[i]], iv_len[i], in mbedtls_gcm_self_test()
882 additional[add_index[i]], add_len[i] ); in mbedtls_gcm_self_test()
891 if( pt_len[i] > 32 ) in mbedtls_gcm_self_test()
893 size_t rest_len = pt_len[i] - 32; in mbedtls_gcm_self_test()
894 ret = mbedtls_gcm_update( &ctx, 32, ct[j * 6 + i], buf ); in mbedtls_gcm_self_test()
903 ret = mbedtls_gcm_update( &ctx, rest_len, ct[j * 6 + i] + 32, in mbedtls_gcm_self_test()
915 ret = mbedtls_gcm_update( &ctx, pt_len[i], ct[j * 6 + i], buf ); in mbedtls_gcm_self_test()
927 memcmp( buf, pt[pt_index[i]], pt_len[i] ) != 0 || in mbedtls_gcm_self_test()
928 memcmp( tag_buf, tag[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()