Lines Matching refs:i

80     int ret, i, j;  in gcm_gen_table()  local
113 for( i = 4; i > 0; i >>= 1 ) in gcm_gen_table()
119 ctx->HL[i] = vl; in gcm_gen_table()
120 ctx->HH[i] = vh; in gcm_gen_table()
123 for( i = 2; i <= 8; i *= 2 ) in gcm_gen_table()
125 uint64_t *HiL = ctx->HL + i, *HiH = ctx->HH + i; in gcm_gen_table()
128 for( j = 1; j < i; j++ ) in gcm_gen_table()
195 int i = 0; in gcm_mult() local
218 for( i = 15; i >= 0; i-- ) in gcm_mult()
220 lo = x[i] & 0xf; in gcm_mult()
221 hi = ( x[i] >> 4 ) & 0xf; in gcm_mult()
223 if( i != 15 ) in gcm_mult()
257 size_t i; in mbedtls_gcm_starts() local
298 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_starts()
299 ctx->y[i] ^= p[i]; in mbedtls_gcm_starts()
307 for( i = 0; i < 16; i++ ) in mbedtls_gcm_starts()
308 ctx->y[i] ^= work_buf[i]; in mbedtls_gcm_starts()
325 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_starts()
326 ctx->buf[i] ^= p[i]; in mbedtls_gcm_starts()
344 size_t i; in mbedtls_gcm_update() local
371 for( i = 16; i > 12; i-- ) in mbedtls_gcm_update()
372 if( ++ctx->y[i - 1] != 0 ) in mbedtls_gcm_update()
381 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_update()
384 ctx->buf[i] ^= p[i]; in mbedtls_gcm_update()
385 out_p[i] = ectr[i] ^ p[i]; in mbedtls_gcm_update()
387 ctx->buf[i] ^= out_p[i]; in mbedtls_gcm_update()
405 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()
487 size_t i; in mbedtls_gcm_auth_decrypt() local
505 for( diff = 0, i = 0; i < tag_len; i++ ) in mbedtls_gcm_auth_decrypt()
506 diff |= tag[i] ^ check_tag[i]; in mbedtls_gcm_auth_decrypt()
760 int i, j, ret; in mbedtls_gcm_self_test() local
767 for( i = 0; i < MAX_TESTS; i++ ) in mbedtls_gcm_self_test()
773 key_len, i, "enc" ); in mbedtls_gcm_self_test()
776 key_test_data[key_index_test_data[i]], in mbedtls_gcm_self_test()
794 pt_len_test_data[i], in mbedtls_gcm_self_test()
795 iv_test_data[iv_index_test_data[i]], in mbedtls_gcm_self_test()
796 iv_len_test_data[i], in mbedtls_gcm_self_test()
797 additional_test_data[add_index_test_data[i]], in mbedtls_gcm_self_test()
798 add_len_test_data[i], in mbedtls_gcm_self_test()
799 pt_test_data[pt_index_test_data[i]], in mbedtls_gcm_self_test()
804 iv_len_test_data[i] != 12 ) in mbedtls_gcm_self_test()
813 if ( memcmp( buf, ct_test_data[j * 6 + i], in mbedtls_gcm_self_test()
814 pt_len_test_data[i] ) != 0 || in mbedtls_gcm_self_test()
815 memcmp( tag_buf, tag_test_data[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()
830 key_len, i, "dec" ); in mbedtls_gcm_self_test()
833 key_test_data[key_index_test_data[i]], in mbedtls_gcm_self_test()
839 pt_len_test_data[i], in mbedtls_gcm_self_test()
840 iv_test_data[iv_index_test_data[i]], in mbedtls_gcm_self_test()
841 iv_len_test_data[i], in mbedtls_gcm_self_test()
842 additional_test_data[add_index_test_data[i]], in mbedtls_gcm_self_test()
843 add_len_test_data[i], in mbedtls_gcm_self_test()
844 ct_test_data[j * 6 + i], buf, 16, tag_buf ); in mbedtls_gcm_self_test()
849 if( memcmp( buf, pt_test_data[pt_index_test_data[i]], in mbedtls_gcm_self_test()
850 pt_len_test_data[i] ) != 0 || in mbedtls_gcm_self_test()
851 memcmp( tag_buf, tag_test_data[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()
866 key_len, i, "enc" ); in mbedtls_gcm_self_test()
869 key_test_data[key_index_test_data[i]], in mbedtls_gcm_self_test()
875 iv_test_data[iv_index_test_data[i]], in mbedtls_gcm_self_test()
876 iv_len_test_data[i], in mbedtls_gcm_self_test()
877 additional_test_data[add_index_test_data[i]], in mbedtls_gcm_self_test()
878 add_len_test_data[i] ); in mbedtls_gcm_self_test()
882 if( pt_len_test_data[i] > 32 ) in mbedtls_gcm_self_test()
884 size_t rest_len = pt_len_test_data[i] - 32; in mbedtls_gcm_self_test()
886 pt_test_data[pt_index_test_data[i]], in mbedtls_gcm_self_test()
892 pt_test_data[pt_index_test_data[i]] + 32, in mbedtls_gcm_self_test()
899 ret = mbedtls_gcm_update( &ctx, pt_len_test_data[i], in mbedtls_gcm_self_test()
900 pt_test_data[pt_index_test_data[i]], in mbedtls_gcm_self_test()
910 if( memcmp( buf, ct_test_data[j * 6 + i], in mbedtls_gcm_self_test()
911 pt_len_test_data[i] ) != 0 || in mbedtls_gcm_self_test()
912 memcmp( tag_buf, tag_test_data[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()
927 key_len, i, "dec" ); in mbedtls_gcm_self_test()
930 key_test_data[key_index_test_data[i]], in mbedtls_gcm_self_test()
936 iv_test_data[iv_index_test_data[i]], in mbedtls_gcm_self_test()
937 iv_len_test_data[i], in mbedtls_gcm_self_test()
938 additional_test_data[add_index_test_data[i]], in mbedtls_gcm_self_test()
939 add_len_test_data[i] ); in mbedtls_gcm_self_test()
943 if( pt_len_test_data[i] > 32 ) in mbedtls_gcm_self_test()
945 size_t rest_len = pt_len_test_data[i] - 32; in mbedtls_gcm_self_test()
946 ret = mbedtls_gcm_update( &ctx, 32, ct_test_data[j * 6 + i], in mbedtls_gcm_self_test()
952 ct_test_data[j * 6 + i] + 32, in mbedtls_gcm_self_test()
959 ret = mbedtls_gcm_update( &ctx, pt_len_test_data[i], in mbedtls_gcm_self_test()
960 ct_test_data[j * 6 + i], in mbedtls_gcm_self_test()
970 if( memcmp( buf, pt_test_data[pt_index_test_data[i]], in mbedtls_gcm_self_test()
971 pt_len_test_data[i] ) != 0 || in mbedtls_gcm_self_test()
972 memcmp( tag_buf, tag_test_data[j * 6 + i], 16 ) != 0 ) in mbedtls_gcm_self_test()