Lines Matching refs:p

130         ctx->s.p == NULL )  in mbedtls_ecjpake_check()
141 static int ecjpake_write_len_point( unsigned char **p, in ecjpake_write_len_point() argument
151 if( end < *p || end - *p < 5 ) in ecjpake_write_len_point()
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()
189 unsigned char *p = buf; in ecjpake_hash() local
195 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, G ) ); in ecjpake_hash()
196 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, V ) ); in ecjpake_hash()
197 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, X ) ); in ecjpake_hash()
199 if( end - p < 4 ) in ecjpake_hash()
202 *p++ = (unsigned char)( ( id_len >> 24 ) & 0xFF ); in ecjpake_hash()
203 *p++ = (unsigned char)( ( id_len >> 16 ) & 0xFF ); in ecjpake_hash()
204 *p++ = (unsigned char)( ( id_len >> 8 ) & 0xFF ); in ecjpake_hash()
205 *p++ = (unsigned char)( ( id_len ) & 0xFF ); in ecjpake_hash()
207 if( end < p || (size_t)( end - p ) < id_len ) in ecjpake_hash()
210 memcpy( p, id, id_len ); in ecjpake_hash()
211 p += id_len; in ecjpake_hash()
214 mbedtls_md( md_info, buf, p - buf, hash ); in ecjpake_hash()
234 const unsigned char **p, in ecjpake_zkp_read() argument
253 if( end < *p ) in ecjpake_zkp_read()
256 MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_point( grp, &V, p, end - *p ) ); in ecjpake_zkp_read()
258 if( end < *p || (size_t)( end - *p ) < 1 ) in ecjpake_zkp_read()
264 r_len = *(*p)++; in ecjpake_zkp_read()
266 if( end < *p || (size_t)( end - *p ) < r_len ) in ecjpake_zkp_read()
272 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &r, *p, r_len ) ); in ecjpake_zkp_read()
273 *p += r_len; in ecjpake_zkp_read()
307 unsigned char **p, in ecjpake_zkp_write() argument
318 if( end < *p ) in ecjpake_zkp_write()
335 pf, &len, *p, end - *p ) ); in ecjpake_zkp_write()
336 *p += len; 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()
367 const unsigned char **p, in ecjpake_kkp_read() argument
372 if( end < *p ) in ecjpake_kkp_read()
381 MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_point( grp, X, p, end - *p ) ); in ecjpake_kkp_read()
388 MBEDTLS_MPI_CHK( ecjpake_zkp_read( md_info, grp, pf, G, X, id, p, end ) ); in ecjpake_kkp_read()
405 unsigned char **p, in ecjpake_kkp_write() argument
413 if( end < *p ) in ecjpake_kkp_write()
420 pf, &len, *p, end - *p ) ); in ecjpake_kkp_write()
421 *p += len; in ecjpake_kkp_write()
425 p, end, f_rng, p_rng ) ); in ecjpake_kkp_write()
446 const unsigned char *p = buf; in ecjpake_kkpp_read() local
454 MBEDTLS_MPI_CHK( ecjpake_kkp_read( md_info, grp, pf, G, Xa, id, &p, end ) ); in ecjpake_kkpp_read()
455 MBEDTLS_MPI_CHK( ecjpake_kkp_read( md_info, grp, pf, G, Xb, id, &p, end ) ); in ecjpake_kkpp_read()
457 if( p != end ) in ecjpake_kkpp_read()
484 unsigned char *p = buf; in ecjpake_kkpp_write() local
488 &p, end, f_rng, p_rng ) ); in ecjpake_kkpp_write()
490 &p, end, f_rng, p_rng ) ); in ecjpake_kkpp_write()
492 *olen = p - buf; in ecjpake_kkpp_write()
556 const unsigned char *p = buf; in mbedtls_ecjpake_read_round_two() local
581 MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_group( &grp, &p, len ) ); in mbedtls_ecjpake_read_round_two()
591 &G, &ctx->Xp, ID_PEER, &p, end ) ); in mbedtls_ecjpake_read_round_two()
593 if( p != end ) in mbedtls_ecjpake_read_round_two()
649 unsigned char *p = buf; in mbedtls_ecjpake_write_round_two() local
680 if( end < p ) in mbedtls_ecjpake_write_round_two()
686 p, end - p ) ); in mbedtls_ecjpake_write_round_two()
687 p += ec_len; in mbedtls_ecjpake_write_round_two()
690 if( end < p ) in mbedtls_ecjpake_write_round_two()
696 ctx->point_format, &ec_len, p, end - p ) ); in mbedtls_ecjpake_write_round_two()
697 p += ec_len; in mbedtls_ecjpake_write_round_two()
702 &p, end, f_rng, p_rng ) ); in mbedtls_ecjpake_write_round_two()
704 *olen = p - buf; in mbedtls_ecjpake_write_round_two()
937 static int ecjpake_lgc( void *p, unsigned char *out, size_t len ) in ecjpake_lgc() argument
940 (void) p; in ecjpake_lgc()