Lines Matching refs:len

68     size_t len = 0;  in pk_write_rsa_pubkey()  local
70 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( p, start, &rsa->E ) ); in pk_write_rsa_pubkey()
71 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( p, start, &rsa->N ) ); in pk_write_rsa_pubkey()
73 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in pk_write_rsa_pubkey()
74 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_CONSTRUCTED | in pk_write_rsa_pubkey()
77 return( (int) len ); in pk_write_rsa_pubkey()
89 size_t len = 0; in pk_write_ec_pubkey() local
94 &len, buf, sizeof( buf ) ) ) != 0 ) in pk_write_ec_pubkey()
99 if( *p < start || (size_t)( *p - start ) < len ) in pk_write_ec_pubkey()
102 *p -= len; in pk_write_ec_pubkey()
103 memcpy( *p, buf, len ); in pk_write_ec_pubkey()
105 return( (int) len ); in pk_write_ec_pubkey()
117 size_t len = 0; in pk_write_ec_param() local
124 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_oid( p, start, oid, oid_len ) ); in pk_write_ec_param()
126 return( (int) len ); in pk_write_ec_param()
134 size_t len = 0; in mbedtls_pk_write_pubkey() local
138 MBEDTLS_ASN1_CHK_ADD( len, pk_write_rsa_pubkey( p, start, mbedtls_pk_rsa( *key ) ) ); in mbedtls_pk_write_pubkey()
143 MBEDTLS_ASN1_CHK_ADD( len, pk_write_ec_pubkey( p, start, mbedtls_pk_ec( *key ) ) ); in mbedtls_pk_write_pubkey()
148 return( (int) len ); in mbedtls_pk_write_pubkey()
155 size_t len = 0, par_len = 0, oid_len; in mbedtls_pk_write_pubkey_der() local
160 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_pk_write_pubkey( &c, buf, key ) ); in mbedtls_pk_write_pubkey_der()
171 len += 1; in mbedtls_pk_write_pubkey_der()
173 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_pk_write_pubkey_der()
174 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_BIT_STRING ) ); in mbedtls_pk_write_pubkey_der()
189 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_algorithm_identifier( &c, buf, oid, oid_len, in mbedtls_pk_write_pubkey_der()
192 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_pk_write_pubkey_der()
193 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_pk_write_pubkey_der()
196 return( (int) len ); in mbedtls_pk_write_pubkey_der()
203 size_t len = 0; in mbedtls_pk_write_key_der() local
210 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->QP ) ); in mbedtls_pk_write_key_der()
211 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->DQ ) ); in mbedtls_pk_write_key_der()
212 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->DP ) ); in mbedtls_pk_write_key_der()
213 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->Q ) ); in mbedtls_pk_write_key_der()
214 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->P ) ); in mbedtls_pk_write_key_der()
215 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->D ) ); in mbedtls_pk_write_key_der()
216 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->E ) ); in mbedtls_pk_write_key_der()
217 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &rsa->N ) ); in mbedtls_pk_write_key_der()
218 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_int( &c, buf, 0 ) ); in mbedtls_pk_write_key_der()
220 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_pk_write_key_der()
221 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_pk_write_key_der()
257 len += pub_len; in mbedtls_pk_write_key_der()
265 len += par_len; in mbedtls_pk_write_key_der()
268 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &ec->d ) ); in mbedtls_pk_write_key_der()
272 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_int( &c, buf, 1 ) ); in mbedtls_pk_write_key_der()
274 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_pk_write_key_der()
275 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_pk_write_key_der()
282 return( (int) len ); in mbedtls_pk_write_key_der()