Lines Matching refs:len

103                            size_t len )  in mbedtls_ecjpake_setup()  argument
114 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &ctx->s, secret, len ) ); in mbedtls_ecjpake_setup()
148 size_t len; in ecjpake_write_len_point() local
155 &len, *p + 4, end - ( *p + 4 ) ); in ecjpake_write_len_point()
159 (*p)[0] = (unsigned char)( ( len >> 24 ) & 0xFF ); in ecjpake_write_len_point()
160 (*p)[1] = (unsigned char)( ( len >> 16 ) & 0xFF ); in ecjpake_write_len_point()
161 (*p)[2] = (unsigned char)( ( len >> 8 ) & 0xFF ); in ecjpake_write_len_point()
162 (*p)[3] = (unsigned char)( ( len ) & 0xFF ); in ecjpake_write_len_point()
164 *p += 4 + len; in ecjpake_write_len_point()
316 size_t len; in ecjpake_zkp_write() local
335 pf, &len, *p, end - *p ) ); in ecjpake_zkp_write()
336 *p += len; in ecjpake_zkp_write()
338 len = mbedtls_mpi_size( &h ); /* actually r */ in ecjpake_zkp_write()
339 if( end < *p || (size_t)( end - *p ) < 1 + len || len > 255 ) in ecjpake_zkp_write()
345 *(*p)++ = (unsigned char)( len & 0xFF ); in ecjpake_zkp_write()
346 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &h, *p, len ) ); /* r */ in ecjpake_zkp_write()
347 *p += len; in ecjpake_zkp_write()
411 size_t len; in ecjpake_kkp_write() local
420 pf, &len, *p, end - *p ) ); in ecjpake_kkp_write()
421 *p += len; in ecjpake_kkp_write()
443 size_t len ) in ecjpake_kkpp_read() argument
447 const unsigned char *end = buf + len; in ecjpake_kkpp_read()
478 size_t len, in ecjpake_kkpp_write() argument
485 const unsigned char *end = buf + len; in ecjpake_kkpp_write()
503 size_t len ) in mbedtls_ecjpake_read_round_one() argument
508 buf, len ) ); in mbedtls_ecjpake_read_round_one()
515 unsigned char *buf, size_t len, size_t *olen, in mbedtls_ecjpake_write_round_one() argument
522 ID_MINE, buf, len, olen, f_rng, p_rng ) ); in mbedtls_ecjpake_write_round_one()
553 size_t len ) in mbedtls_ecjpake_read_round_two() argument
557 const unsigned char *end = buf + len; in mbedtls_ecjpake_read_round_two()
581 MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_group( &grp, &p, len ) ); in mbedtls_ecjpake_read_round_two()
641 unsigned char *buf, size_t len, size_t *olen, in mbedtls_ecjpake_write_round_two() argument
650 const unsigned char *end = buf + len; in mbedtls_ecjpake_write_round_two()
718 unsigned char *buf, size_t len, size_t *olen, in mbedtls_ecjpake_derive_secret() argument
729 if( len < *olen ) in mbedtls_ecjpake_derive_secret()
937 static int ecjpake_lgc( void *p, unsigned char *out, size_t len ) in ecjpake_lgc() argument
942 while( len > 0 ) in ecjpake_lgc()
944 size_t use_len = len > 4 ? 4 : len; in ecjpake_lgc()
948 len -= use_len; in ecjpake_lgc()
974 size_t len, pmslen; in mbedtls_ecjpake_self_test() local
999 buf, sizeof( buf ), &len, ecjpake_lgc, NULL ) == 0 ); in mbedtls_ecjpake_self_test()
1001 TEST_ASSERT( mbedtls_ecjpake_read_round_one( &srv, buf, len ) == 0 ); in mbedtls_ecjpake_self_test()
1004 buf, sizeof( buf ), &len, ecjpake_lgc, NULL ) == 0 ); in mbedtls_ecjpake_self_test()
1006 TEST_ASSERT( mbedtls_ecjpake_read_round_one( &cli, buf, len ) == 0 ); in mbedtls_ecjpake_self_test()
1009 buf, sizeof( buf ), &len, ecjpake_lgc, NULL ) == 0 ); in mbedtls_ecjpake_self_test()
1011 TEST_ASSERT( mbedtls_ecjpake_read_round_two( &cli, buf, len ) == 0 ); in mbedtls_ecjpake_self_test()
1017 buf, sizeof( buf ), &len, ecjpake_lgc, NULL ) == 0 ); in mbedtls_ecjpake_self_test()
1019 TEST_ASSERT( mbedtls_ecjpake_read_round_two( &srv, buf, len ) == 0 ); in mbedtls_ecjpake_self_test()
1022 buf, sizeof( buf ), &len, ecjpake_lgc, NULL ) == 0 ); in mbedtls_ecjpake_self_test()
1024 TEST_ASSERT( len == pmslen ); in mbedtls_ecjpake_self_test()
1025 TEST_ASSERT( memcmp( buf, pms, len ) == 0 ); in mbedtls_ecjpake_self_test()
1062 buf, sizeof( buf ), &len, ecjpake_lgc, NULL ) == 0 ); in mbedtls_ecjpake_self_test()
1064 TEST_ASSERT( len == sizeof( ecjpake_test_pms ) ); in mbedtls_ecjpake_self_test()
1065 TEST_ASSERT( memcmp( buf, ecjpake_test_pms, len ) == 0 ); in mbedtls_ecjpake_self_test()
1067 memset( buf, 0, len ); /* Avoid interferences with next step */ in mbedtls_ecjpake_self_test()
1071 buf, sizeof( buf ), &len, ecjpake_lgc, NULL ) == 0 ); in mbedtls_ecjpake_self_test()
1073 TEST_ASSERT( len == sizeof( ecjpake_test_pms ) ); in mbedtls_ecjpake_self_test()
1074 TEST_ASSERT( memcmp( buf, ecjpake_test_pms, len ) == 0 ); in mbedtls_ecjpake_self_test()