Lines Matching refs:p
146 ctx->s.p == NULL) { in mbedtls_ecjpake_check()
156 static int ecjpake_write_len_point(unsigned char **p, in ecjpake_write_len_point() argument
166 if (end < *p || end - *p < 5) { in ecjpake_write_len_point()
171 &len, *p + 4, end - (*p + 4)); in ecjpake_write_len_point()
176 MBEDTLS_PUT_UINT32_BE(len, *p, 0); in ecjpake_write_len_point()
178 *p += 4 + len; in ecjpake_write_len_point()
203 unsigned char *p = buf; in ecjpake_hash() local
209 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, G)); in ecjpake_hash()
210 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, V)); in ecjpake_hash()
211 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, X)); in ecjpake_hash()
213 if (end - p < 4) { in ecjpake_hash()
217 MBEDTLS_PUT_UINT32_BE(id_len, p, 0); in ecjpake_hash()
218 p += 4; in ecjpake_hash()
220 if (end < p || (size_t) (end - p) < id_len) { in ecjpake_hash()
224 memcpy(p, id, id_len); in ecjpake_hash()
225 p += id_len; in ecjpake_hash()
229 buf, p - buf, hash)); in ecjpake_hash()
249 const unsigned char **p, in ecjpake_zkp_read() argument
268 if (end < *p) { in ecjpake_zkp_read()
272 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_point(grp, &V, p, end - *p)); in ecjpake_zkp_read()
274 if (end < *p || (size_t) (end - *p) < 1) { in ecjpake_zkp_read()
279 r_len = *(*p)++; in ecjpake_zkp_read()
281 if (end < *p || (size_t) (end - *p) < r_len || r_len == 0) { in ecjpake_zkp_read()
286 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&r, *p, r_len)); in ecjpake_zkp_read()
287 *p += r_len; in ecjpake_zkp_read()
320 unsigned char **p, in ecjpake_zkp_write() argument
331 if (end < *p) { in ecjpake_zkp_write()
349 pf, &len, *p, end - *p)); in ecjpake_zkp_write()
350 *p += len; in ecjpake_zkp_write()
353 if (end < *p || (size_t) (end - *p) < 1 + len || len > 255) { in ecjpake_zkp_write()
358 *(*p)++ = MBEDTLS_BYTE_0(len); in ecjpake_zkp_write()
359 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&h, *p, len)); /* r */ in ecjpake_zkp_write()
360 *p += len; in ecjpake_zkp_write()
380 const unsigned char **p, in ecjpake_kkp_read() argument
385 if (end < *p) { in ecjpake_kkp_read()
395 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_point(grp, X, p, end - *p)); in ecjpake_kkp_read()
401 MBEDTLS_MPI_CHK(ecjpake_zkp_read(md_type, grp, pf, G, X, id, p, end)); in ecjpake_kkp_read()
418 unsigned char **p, in ecjpake_kkp_write() argument
426 if (end < *p) { in ecjpake_kkp_write()
434 pf, &len, *p, end - *p)); in ecjpake_kkp_write()
435 *p += len; in ecjpake_kkp_write()
439 p, end, f_rng, p_rng)); in ecjpake_kkp_write()
460 const unsigned char *p = buf; in ecjpake_kkpp_read() local
468 MBEDTLS_MPI_CHK(ecjpake_kkp_read(md_type, grp, pf, G, Xa, id, &p, end)); in ecjpake_kkpp_read()
469 MBEDTLS_MPI_CHK(ecjpake_kkp_read(md_type, grp, pf, G, Xb, id, &p, end)); in ecjpake_kkpp_read()
471 if (p != end) { in ecjpake_kkpp_read()
499 unsigned char *p = buf; in ecjpake_kkpp_write() local
503 &p, end, f_rng, p_rng)); in ecjpake_kkpp_write()
505 &p, end, f_rng, p_rng)); in ecjpake_kkpp_write()
507 *olen = p - buf; in ecjpake_kkpp_write()
571 const unsigned char *p = buf; in mbedtls_ecjpake_read_round_two() local
595 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_group(&grp, &p, len)); in mbedtls_ecjpake_read_round_two()
604 &G, &ctx->Xp, ID_PEER, &p, end)); in mbedtls_ecjpake_read_round_two()
606 if (p != end) { in mbedtls_ecjpake_read_round_two()
661 unsigned char *p = buf; in mbedtls_ecjpake_write_round_two() local
691 if (end < p) { in mbedtls_ecjpake_write_round_two()
696 p, end - p)); in mbedtls_ecjpake_write_round_two()
697 p += ec_len; in mbedtls_ecjpake_write_round_two()
700 if (end < p) { in mbedtls_ecjpake_write_round_two()
705 ctx->point_format, &ec_len, p, end - p)); in mbedtls_ecjpake_write_round_two()
706 p += ec_len; in mbedtls_ecjpake_write_round_two()
711 &p, end, f_rng, p_rng)); in mbedtls_ecjpake_write_round_two()
713 *olen = p - buf; in mbedtls_ecjpake_write_round_two()
1023 static int ecjpake_lgc(void *p, unsigned char *out, size_t len) in ecjpake_lgc() argument
1026 (void) p; in ecjpake_lgc()