Lines Matching refs:i
130 size_t i = 0; in calc_a_xor_t() local
131 for( i = 0; i < sizeof( t ); i++ ) in calc_a_xor_t()
133 A[i] ^= ( t >> ( ( sizeof( t ) - 1 - i ) * 8 ) ) & 0xff; in calc_a_xor_t()
351 size_t i, olen; in mbedtls_nist_kw_unwrap() local
453 for( diff = 0, i = 0; i < KW_SEMIBLOCK_LENGTH; i++ ) in mbedtls_nist_kw_unwrap()
455 if( i >= KW_SEMIBLOCK_LENGTH - padlen ) in mbedtls_nist_kw_unwrap()
456 diff |= output[*out_len - KW_SEMIBLOCK_LENGTH + i]; in mbedtls_nist_kw_unwrap()
458 bad_padding |= output[*out_len - KW_SEMIBLOCK_LENGTH + i]; in mbedtls_nist_kw_unwrap()
590 int i; in mbedtls_nist_kw_self_test() local
594 for( i = 0; i < KW_TESTS; i++ ) in mbedtls_nist_kw_self_test()
597 mbedtls_printf( " KW-AES-%u ", (unsigned int) key_len[i] * 8 ); in mbedtls_nist_kw_self_test()
600 kw_key[i], key_len[i] * 8, 1 ); in mbedtls_nist_kw_self_test()
609 ret = mbedtls_nist_kw_wrap( &ctx, MBEDTLS_KW_MODE_KW, kw_msg[i], in mbedtls_nist_kw_self_test()
610 kw_msg_len[i], out, &olen, sizeof( out ) ); in mbedtls_nist_kw_self_test()
611 if( ret != 0 || kw_out_len[i] != olen || in mbedtls_nist_kw_self_test()
612 memcmp( out, kw_res[i], kw_out_len[i] ) != 0 ) in mbedtls_nist_kw_self_test()
622 kw_key[i], key_len[i] * 8, 0 ) ) in mbedtls_nist_kw_self_test()
634 if( ret != 0 || olen != kw_msg_len[i] || in mbedtls_nist_kw_self_test()
635 memcmp( out, kw_msg[i], kw_msg_len[i] ) != 0 ) in mbedtls_nist_kw_self_test()
648 for( i = 0; i < KW_TESTS; i++ ) in mbedtls_nist_kw_self_test()
652 mbedtls_printf( " KWP-AES-%u ", (unsigned int) key_len[i] * 8 ); in mbedtls_nist_kw_self_test()
654 ret = mbedtls_nist_kw_setkey( &ctx, MBEDTLS_CIPHER_ID_AES, kwp_key[i], in mbedtls_nist_kw_self_test()
655 key_len[i] * 8, 1 ); in mbedtls_nist_kw_self_test()
663 ret = mbedtls_nist_kw_wrap( &ctx, MBEDTLS_KW_MODE_KWP, kwp_msg[i], in mbedtls_nist_kw_self_test()
664 kwp_msg_len[i], out, &olen, sizeof( out ) ); in mbedtls_nist_kw_self_test()
666 if( ret != 0 || kwp_out_len[i] != olen || in mbedtls_nist_kw_self_test()
667 memcmp( out, kwp_res[i], kwp_out_len[i] ) != 0 ) in mbedtls_nist_kw_self_test()
677 kwp_key[i], key_len[i] * 8, 0 ) ) in mbedtls_nist_kw_self_test()
689 if( ret != 0 || olen != kwp_msg_len[i] || in mbedtls_nist_kw_self_test()
690 memcmp( out, kwp_msg[i], kwp_msg_len[i] ) != 0 ) in mbedtls_nist_kw_self_test()