Lines Matching refs:len
42 int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ) in mbedtls_asn1_write_len() argument
44 if( len < 0x80 ) in mbedtls_asn1_write_len()
49 *--(*p) = (unsigned char) len; in mbedtls_asn1_write_len()
53 if( len <= 0xFF ) in mbedtls_asn1_write_len()
58 *--(*p) = (unsigned char) len; in mbedtls_asn1_write_len()
63 if( len <= 0xFFFF ) in mbedtls_asn1_write_len()
68 *--(*p) = ( len ) & 0xFF; in mbedtls_asn1_write_len()
69 *--(*p) = ( len >> 8 ) & 0xFF; in mbedtls_asn1_write_len()
74 if( len <= 0xFFFFFF ) in mbedtls_asn1_write_len()
79 *--(*p) = ( len ) & 0xFF; in mbedtls_asn1_write_len()
80 *--(*p) = ( len >> 8 ) & 0xFF; in mbedtls_asn1_write_len()
81 *--(*p) = ( len >> 16 ) & 0xFF; in mbedtls_asn1_write_len()
86 if( len <= 0xFFFFFFFF ) in mbedtls_asn1_write_len()
91 *--(*p) = ( len ) & 0xFF; in mbedtls_asn1_write_len()
92 *--(*p) = ( len >> 8 ) & 0xFF; in mbedtls_asn1_write_len()
93 *--(*p) = ( len >> 16 ) & 0xFF; in mbedtls_asn1_write_len()
94 *--(*p) = ( len >> 24 ) & 0xFF; in mbedtls_asn1_write_len()
115 size_t len = 0; in mbedtls_asn1_write_raw_buffer() local
120 len = size; in mbedtls_asn1_write_raw_buffer()
121 (*p) -= len; in mbedtls_asn1_write_raw_buffer()
122 memcpy( *p, buf, len ); in mbedtls_asn1_write_raw_buffer()
124 return( (int) len ); in mbedtls_asn1_write_raw_buffer()
131 size_t len = 0; in mbedtls_asn1_write_mpi() local
135 len = mbedtls_mpi_size( X ); in mbedtls_asn1_write_mpi()
137 if( *p < start || (size_t)( *p - start ) < len ) in mbedtls_asn1_write_mpi()
140 (*p) -= len; in mbedtls_asn1_write_mpi()
141 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( X, *p, len ) ); in mbedtls_asn1_write_mpi()
152 len += 1; in mbedtls_asn1_write_mpi()
155 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_mpi()
156 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_INTEGER ) ); in mbedtls_asn1_write_mpi()
158 ret = (int) len; in mbedtls_asn1_write_mpi()
168 size_t len = 0; in mbedtls_asn1_write_null() local
172 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, 0) ); in mbedtls_asn1_write_null()
173 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_NULL ) ); in mbedtls_asn1_write_null()
175 return( (int) len ); in mbedtls_asn1_write_null()
182 size_t len = 0; in mbedtls_asn1_write_oid() local
184 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, in mbedtls_asn1_write_oid()
186 MBEDTLS_ASN1_CHK_ADD( len , mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_oid()
187 MBEDTLS_ASN1_CHK_ADD( len , mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_OID ) ); in mbedtls_asn1_write_oid()
189 return( (int) len ); in mbedtls_asn1_write_oid()
197 size_t len = 0; in mbedtls_asn1_write_algorithm_identifier() local
200 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_null( p, start ) ); in mbedtls_asn1_write_algorithm_identifier()
202 len += par_len; in mbedtls_asn1_write_algorithm_identifier()
204 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_oid( p, start, oid, oid_len ) ); in mbedtls_asn1_write_algorithm_identifier()
206 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_algorithm_identifier()
207 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, in mbedtls_asn1_write_algorithm_identifier()
210 return( (int) len ); in mbedtls_asn1_write_algorithm_identifier()
216 size_t len = 0; in mbedtls_asn1_write_bool() local
222 len++; in mbedtls_asn1_write_bool()
224 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_bool()
225 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_BOOLEAN ) ); in mbedtls_asn1_write_bool()
227 return( (int) len ); in mbedtls_asn1_write_bool()
233 size_t len = 0; in mbedtls_asn1_write_int() local
242 len += 1; in mbedtls_asn1_write_int()
251 len += 1; in mbedtls_asn1_write_int()
254 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_int()
255 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_INTEGER ) ); in mbedtls_asn1_write_int()
257 return( (int) len ); in mbedtls_asn1_write_int()
264 size_t len = 0; in mbedtls_asn1_write_printable_string() local
266 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, in mbedtls_asn1_write_printable_string()
269 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_printable_string()
270 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_PRINTABLE_STRING ) ); in mbedtls_asn1_write_printable_string()
272 return( (int) len ); in mbedtls_asn1_write_printable_string()
279 size_t len = 0; in mbedtls_asn1_write_ia5_string() local
281 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, in mbedtls_asn1_write_ia5_string()
284 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_ia5_string()
285 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_IA5_STRING ) ); in mbedtls_asn1_write_ia5_string()
287 return( (int) len ); in mbedtls_asn1_write_ia5_string()
294 size_t len = 0, size; in mbedtls_asn1_write_bitstring() local
303 len = size + 1; in mbedtls_asn1_write_bitstring()
311 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_bitstring()
312 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_BIT_STRING ) ); in mbedtls_asn1_write_bitstring()
314 return( (int) len ); in mbedtls_asn1_write_bitstring()
321 size_t len = 0; in mbedtls_asn1_write_octet_string() local
323 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, buf, size ) ); in mbedtls_asn1_write_octet_string()
325 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_asn1_write_octet_string()
326 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_OCTET_STRING ) ); in mbedtls_asn1_write_octet_string()
328 return( (int) len ); in mbedtls_asn1_write_octet_string()
347 cur->oid.len = oid_len; in mbedtls_asn1_store_named_data()
357 cur->val.len = val_len; in mbedtls_asn1_store_named_data()
369 else if( cur->val.len < val_len ) in mbedtls_asn1_store_named_data()
382 cur->val.len = val_len; in mbedtls_asn1_store_named_data()