Lines Matching refs:p
189 ctx->s.p == NULL) { in mbedtls_ecjpake_check()
199 static int ecjpake_write_len_point(unsigned char **p, in ecjpake_write_len_point() argument
209 if (end < *p || end - *p < 5) { in ecjpake_write_len_point()
214 &len, *p + 4, end - (*p + 4)); in ecjpake_write_len_point()
219 MBEDTLS_PUT_UINT32_BE(len, *p, 0); in ecjpake_write_len_point()
221 *p += 4 + len; in ecjpake_write_len_point()
246 unsigned char *p = buf; in ecjpake_hash() local
252 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, G)); in ecjpake_hash()
253 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, V)); in ecjpake_hash()
254 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, X)); in ecjpake_hash()
256 if (end - p < 4) { in ecjpake_hash()
260 MBEDTLS_PUT_UINT32_BE(id_len, p, 0); in ecjpake_hash()
261 p += 4; in ecjpake_hash()
263 if (end < p || (size_t) (end - p) < id_len) { in ecjpake_hash()
267 memcpy(p, id, id_len); in ecjpake_hash()
268 p += id_len; in ecjpake_hash()
272 buf, p - buf, hash)); in ecjpake_hash()
292 const unsigned char **p, in ecjpake_zkp_read() argument
311 if (end < *p) { in ecjpake_zkp_read()
315 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_point(grp, &V, p, end - *p)); in ecjpake_zkp_read()
317 if (end < *p || (size_t) (end - *p) < 1) { in ecjpake_zkp_read()
322 r_len = *(*p)++; in ecjpake_zkp_read()
324 if (end < *p || (size_t) (end - *p) < r_len || r_len == 0) { in ecjpake_zkp_read()
329 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&r, *p, r_len)); in ecjpake_zkp_read()
330 *p += r_len; in ecjpake_zkp_read()
363 unsigned char **p, in ecjpake_zkp_write() argument
374 if (end < *p) { in ecjpake_zkp_write()
392 pf, &len, *p, end - *p)); in ecjpake_zkp_write()
393 *p += len; in ecjpake_zkp_write()
396 if (end < *p || (size_t) (end - *p) < 1 + len || len > 255) { in ecjpake_zkp_write()
401 *(*p)++ = MBEDTLS_BYTE_0(len); in ecjpake_zkp_write()
402 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&h, *p, len)); /* r */ in ecjpake_zkp_write()
403 *p += len; in ecjpake_zkp_write()
423 const unsigned char **p, in ecjpake_kkp_read() argument
428 if (end < *p) { in ecjpake_kkp_read()
438 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_point(grp, X, p, end - *p)); in ecjpake_kkp_read()
444 MBEDTLS_MPI_CHK(ecjpake_zkp_read(md_type, grp, pf, G, X, id, p, end)); in ecjpake_kkp_read()
461 unsigned char **p, in ecjpake_kkp_write() argument
469 if (end < *p) { in ecjpake_kkp_write()
477 pf, &len, *p, end - *p)); in ecjpake_kkp_write()
478 *p += len; in ecjpake_kkp_write()
482 p, end, f_rng, p_rng)); in ecjpake_kkp_write()
503 const unsigned char *p = buf; in ecjpake_kkpp_read() local
511 MBEDTLS_MPI_CHK(ecjpake_kkp_read(md_type, grp, pf, G, Xa, id, &p, end)); in ecjpake_kkpp_read()
512 MBEDTLS_MPI_CHK(ecjpake_kkp_read(md_type, grp, pf, G, Xb, id, &p, end)); in ecjpake_kkpp_read()
514 if (p != end) { in ecjpake_kkpp_read()
542 unsigned char *p = buf; in ecjpake_kkpp_write() local
546 &p, end, f_rng, p_rng)); in ecjpake_kkpp_write()
548 &p, end, f_rng, p_rng)); in ecjpake_kkpp_write()
550 *olen = p - buf; in ecjpake_kkpp_write()
614 const unsigned char *p = buf; in mbedtls_ecjpake_read_round_two() local
638 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_group(&grp, &p, len)); in mbedtls_ecjpake_read_round_two()
647 &G, &ctx->Xp, ID_PEER, &p, end)); in mbedtls_ecjpake_read_round_two()
649 if (p != end) { in mbedtls_ecjpake_read_round_two()
704 unsigned char *p = buf; in mbedtls_ecjpake_write_round_two() local
734 if (end < p) { in mbedtls_ecjpake_write_round_two()
739 p, end - p)); in mbedtls_ecjpake_write_round_two()
740 p += ec_len; in mbedtls_ecjpake_write_round_two()
743 if (end < p) { in mbedtls_ecjpake_write_round_two()
748 ctx->point_format, &ec_len, p, end - p)); in mbedtls_ecjpake_write_round_two()
749 p += ec_len; in mbedtls_ecjpake_write_round_two()
754 &p, end, f_rng, p_rng)); in mbedtls_ecjpake_write_round_two()
756 *olen = p - buf; in mbedtls_ecjpake_write_round_two()
1066 static int ecjpake_lgc(void *p, unsigned char *out, size_t len) in ecjpake_lgc() argument
1069 (void) p; in ecjpake_lgc()