Lines Matching refs:p
180 ctx->s.p == NULL ) in mbedtls_ecjpake_check()
191 static int ecjpake_write_len_point( unsigned char **p, in ecjpake_write_len_point() argument
201 if( end < *p || end - *p < 5 ) in ecjpake_write_len_point()
205 &len, *p + 4, end - ( *p + 4 ) ); in ecjpake_write_len_point()
209 MBEDTLS_PUT_UINT32_BE( len, *p, 0 ); in ecjpake_write_len_point()
211 *p += 4 + len; in ecjpake_write_len_point()
236 unsigned char *p = buf; in ecjpake_hash() local
242 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, G ) ); in ecjpake_hash()
243 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, V ) ); in ecjpake_hash()
244 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, X ) ); in ecjpake_hash()
246 if( end - p < 4 ) in ecjpake_hash()
249 MBEDTLS_PUT_UINT32_BE( id_len, p, 0 ); in ecjpake_hash()
250 p += 4; in ecjpake_hash()
252 if( end < p || (size_t)( end - p ) < id_len ) in ecjpake_hash()
255 memcpy( p, id, id_len ); in ecjpake_hash()
256 p += id_len; in ecjpake_hash()
260 buf, p - buf, hash ) ); in ecjpake_hash()
280 const unsigned char **p, in ecjpake_zkp_read() argument
299 if( end < *p ) in ecjpake_zkp_read()
302 MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_point( grp, &V, p, end - *p ) ); in ecjpake_zkp_read()
304 if( end < *p || (size_t)( end - *p ) < 1 ) in ecjpake_zkp_read()
310 r_len = *(*p)++; in ecjpake_zkp_read()
312 if( end < *p || (size_t)( end - *p ) < r_len || r_len == 0 ) in ecjpake_zkp_read()
318 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &r, *p, r_len ) ); in ecjpake_zkp_read()
319 *p += r_len; in ecjpake_zkp_read()
353 unsigned char **p, in ecjpake_zkp_write() argument
364 if( end < *p ) in ecjpake_zkp_write()
381 pf, &len, *p, end - *p ) ); in ecjpake_zkp_write()
382 *p += len; in ecjpake_zkp_write()
385 if( end < *p || (size_t)( end - *p ) < 1 + len || len > 255 ) in ecjpake_zkp_write()
391 *(*p)++ = MBEDTLS_BYTE_0( len ); in ecjpake_zkp_write()
392 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &h, *p, len ) ); /* r */ in ecjpake_zkp_write()
393 *p += len; in ecjpake_zkp_write()
413 const unsigned char **p, in ecjpake_kkp_read() argument
418 if( end < *p ) in ecjpake_kkp_read()
427 MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_point( grp, X, p, end - *p ) ); in ecjpake_kkp_read()
434 MBEDTLS_MPI_CHK( ecjpake_zkp_read( md_type, grp, pf, G, X, id, p, end ) ); in ecjpake_kkp_read()
451 unsigned char **p, in ecjpake_kkp_write() argument
459 if( end < *p ) in ecjpake_kkp_write()
466 pf, &len, *p, end - *p ) ); in ecjpake_kkp_write()
467 *p += len; in ecjpake_kkp_write()
471 p, end, f_rng, p_rng ) ); in ecjpake_kkp_write()
492 const unsigned char *p = buf; in ecjpake_kkpp_read() local
500 MBEDTLS_MPI_CHK( ecjpake_kkp_read( md_type, grp, pf, G, Xa, id, &p, end ) ); in ecjpake_kkpp_read()
501 MBEDTLS_MPI_CHK( ecjpake_kkp_read( md_type, grp, pf, G, Xb, id, &p, end ) ); in ecjpake_kkpp_read()
503 if( p != end ) in ecjpake_kkpp_read()
530 unsigned char *p = buf; in ecjpake_kkpp_write() local
534 &p, end, f_rng, p_rng ) ); in ecjpake_kkpp_write()
536 &p, end, f_rng, p_rng ) ); in ecjpake_kkpp_write()
538 *olen = p - buf; in ecjpake_kkpp_write()
602 const unsigned char *p = buf; in mbedtls_ecjpake_read_round_two() local
627 MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_group( &grp, &p, len ) ); in mbedtls_ecjpake_read_round_two()
637 &G, &ctx->Xp, ID_PEER, &p, end ) ); in mbedtls_ecjpake_read_round_two()
639 if( p != end ) in mbedtls_ecjpake_read_round_two()
695 unsigned char *p = buf; in mbedtls_ecjpake_write_round_two() local
726 if( end < p ) in mbedtls_ecjpake_write_round_two()
732 p, end - p ) ); in mbedtls_ecjpake_write_round_two()
733 p += ec_len; in mbedtls_ecjpake_write_round_two()
736 if( end < p ) in mbedtls_ecjpake_write_round_two()
742 ctx->point_format, &ec_len, p, end - p ) ); in mbedtls_ecjpake_write_round_two()
743 p += ec_len; in mbedtls_ecjpake_write_round_two()
748 &p, end, f_rng, p_rng ) ); in mbedtls_ecjpake_write_round_two()
750 *olen = p - buf; in mbedtls_ecjpake_write_round_two()
1057 static int ecjpake_lgc( void *p, unsigned char *out, size_t len ) in ecjpake_lgc() argument
1060 (void) p; in ecjpake_lgc()