Home
last modified time | relevance | path

Searched refs:cbb (Results 1 – 25 of 176) sorted by relevance

12345678

/external/rust/crates/quiche/deps/boringssl/src/crypto/bytestring/
Dcbb.c26 void CBB_zero(CBB *cbb) { in CBB_zero() argument
27 OPENSSL_memset(cbb, 0, sizeof(CBB)); in CBB_zero()
30 static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { in cbb_init() argument
45 cbb->base = base; in cbb_init()
46 cbb->is_child = 0; in cbb_init()
50 int CBB_init(CBB *cbb, size_t initial_capacity) { in CBB_init() argument
51 CBB_zero(cbb); in CBB_init()
58 if (!cbb_init(cbb, buf, initial_capacity)) { in CBB_init()
66 int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) { in CBB_init_fixed() argument
67 CBB_zero(cbb); in CBB_init_fixed()
[all …]
Dbytestring_test.cc319 CBB cbb; in TEST() local
320 ASSERT_TRUE(CBB_init(&cbb, 100)); in TEST()
321 CBB_cleanup(&cbb); in TEST()
333 bssl::ScopedCBB cbb; in TEST() local
334 ASSERT_TRUE(CBB_init(cbb.get(), 100)); in TEST()
335 cbb.Reset(); in TEST()
337 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
338 ASSERT_TRUE(CBB_add_u8(cbb.get(), 1)); in TEST()
339 ASSERT_TRUE(CBB_add_u16(cbb.get(), 0x203)); in TEST()
340 ASSERT_TRUE(CBB_add_u24(cbb.get(), 0x40506)); in TEST()
[all …]
Dunicode.c120 int cbb_add_utf8(CBB *cbb, uint32_t u) { in cbb_add_utf8() argument
125 return CBB_add_u8(cbb, (uint8_t)u); in cbb_add_utf8()
128 return CBB_add_u8(cbb, TOP_BITS(2) | (u >> 6)) && in cbb_add_utf8()
129 CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); in cbb_add_utf8()
132 return CBB_add_u8(cbb, TOP_BITS(3) | (u >> 12)) && in cbb_add_utf8()
133 CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && in cbb_add_utf8()
134 CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); in cbb_add_utf8()
137 return CBB_add_u8(cbb, TOP_BITS(4) | (u >> 18)) && in cbb_add_utf8()
138 CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 12) & BOTTOM_BITS(6))) && in cbb_add_utf8()
139 CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && in cbb_add_utf8()
[all …]
/external/boringssl/src/crypto/bytestring/
Dcbb.c26 void CBB_zero(CBB *cbb) { in CBB_zero() argument
27 OPENSSL_memset(cbb, 0, sizeof(CBB)); in CBB_zero()
30 static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { in cbb_init() argument
45 cbb->base = base; in cbb_init()
46 cbb->is_child = 0; in cbb_init()
50 int CBB_init(CBB *cbb, size_t initial_capacity) { in CBB_init() argument
51 CBB_zero(cbb); in CBB_init()
58 if (!cbb_init(cbb, buf, initial_capacity)) { in CBB_init()
66 int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) { in CBB_init_fixed() argument
67 CBB_zero(cbb); in CBB_init_fixed()
[all …]
Dbytestring_test.cc319 CBB cbb; in TEST() local
320 ASSERT_TRUE(CBB_init(&cbb, 100)); in TEST()
321 CBB_cleanup(&cbb); in TEST()
333 bssl::ScopedCBB cbb; in TEST() local
334 ASSERT_TRUE(CBB_init(cbb.get(), 100)); in TEST()
335 cbb.Reset(); in TEST()
337 ASSERT_TRUE(CBB_init(cbb.get(), 0)); in TEST()
338 ASSERT_TRUE(CBB_add_u8(cbb.get(), 1)); in TEST()
339 ASSERT_TRUE(CBB_add_u16(cbb.get(), 0x203)); in TEST()
340 ASSERT_TRUE(CBB_add_u24(cbb.get(), 0x40506)); in TEST()
[all …]
Dunicode.c120 int cbb_add_utf8(CBB *cbb, uint32_t u) { in cbb_add_utf8() argument
125 return CBB_add_u8(cbb, (uint8_t)u); in cbb_add_utf8()
128 return CBB_add_u8(cbb, TOP_BITS(2) | (u >> 6)) && in cbb_add_utf8()
129 CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); in cbb_add_utf8()
132 return CBB_add_u8(cbb, TOP_BITS(3) | (u >> 12)) && in cbb_add_utf8()
133 CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && in cbb_add_utf8()
134 CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); in cbb_add_utf8()
137 return CBB_add_u8(cbb, TOP_BITS(4) | (u >> 18)) && in cbb_add_utf8()
138 CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 12) & BOTTOM_BITS(6))) && in cbb_add_utf8()
139 CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && in cbb_add_utf8()
[all …]
/external/rust/crates/quiche/deps/boringssl/src/crypto/dsa/
Ddsa_asn1.c76 static int marshal_integer(CBB *cbb, BIGNUM *bn) { in marshal_integer() argument
82 return BN_marshal_asn1(cbb, bn); in marshal_integer()
102 int DSA_SIG_marshal(CBB *cbb, const DSA_SIG *sig) { in DSA_SIG_marshal() argument
104 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DSA_SIG_marshal()
107 !CBB_flush(cbb)) { in DSA_SIG_marshal()
133 int DSA_marshal_public_key(CBB *cbb, const DSA *dsa) { in DSA_marshal_public_key() argument
135 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DSA_marshal_public_key()
140 !CBB_flush(cbb)) { in DSA_marshal_public_key()
165 int DSA_marshal_parameters(CBB *cbb, const DSA *dsa) { in DSA_marshal_parameters() argument
167 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DSA_marshal_parameters()
[all …]
/external/boringssl/src/crypto/dsa/
Ddsa_asn1.c112 static int marshal_integer(CBB *cbb, BIGNUM *bn) { in marshal_integer() argument
118 return BN_marshal_asn1(cbb, bn); in marshal_integer()
138 int DSA_SIG_marshal(CBB *cbb, const DSA_SIG *sig) { in DSA_SIG_marshal() argument
140 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DSA_SIG_marshal()
143 !CBB_flush(cbb)) { in DSA_SIG_marshal()
175 int DSA_marshal_public_key(CBB *cbb, const DSA *dsa) { in DSA_marshal_public_key() argument
177 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DSA_marshal_public_key()
182 !CBB_flush(cbb)) { in DSA_marshal_public_key()
213 int DSA_marshal_parameters(CBB *cbb, const DSA *dsa) { in DSA_marshal_parameters() argument
215 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DSA_marshal_parameters()
[all …]
/external/boringssl/src/crypto/rsa_extra/
Drsa_asn1.c81 static int marshal_integer(CBB *cbb, BIGNUM *bn) { in marshal_integer() argument
87 return BN_marshal_asn1(cbb, bn); in marshal_integer()
127 int RSA_marshal_public_key(CBB *cbb, const RSA *rsa) { in RSA_marshal_public_key() argument
129 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in RSA_marshal_public_key()
132 !CBB_flush(cbb)) { in RSA_marshal_public_key()
141 CBB cbb; in RSA_public_key_to_bytes() local
142 CBB_zero(&cbb); in RSA_public_key_to_bytes()
143 if (!CBB_init(&cbb, 0) || in RSA_public_key_to_bytes()
144 !RSA_marshal_public_key(&cbb, rsa) || in RSA_public_key_to_bytes()
145 !CBB_finish(&cbb, out_bytes, out_len)) { in RSA_public_key_to_bytes()
[all …]
/external/rust/crates/quiche/deps/boringssl/src/crypto/rsa_extra/
Drsa_asn1.c81 static int marshal_integer(CBB *cbb, BIGNUM *bn) { in marshal_integer() argument
87 return BN_marshal_asn1(cbb, bn); in marshal_integer()
127 int RSA_marshal_public_key(CBB *cbb, const RSA *rsa) { in RSA_marshal_public_key() argument
129 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in RSA_marshal_public_key()
132 !CBB_flush(cbb)) { in RSA_marshal_public_key()
141 CBB cbb; in RSA_public_key_to_bytes() local
142 CBB_zero(&cbb); in RSA_public_key_to_bytes()
143 if (!CBB_init(&cbb, 0) || in RSA_public_key_to_bytes()
144 !RSA_marshal_public_key(&cbb, rsa) || in RSA_public_key_to_bytes()
145 !CBB_finish(&cbb, out_bytes, out_len)) { in RSA_public_key_to_bytes()
[all …]
/external/rust/crates/quiche/deps/boringssl/src/include/openssl/
Dbytestring.h374 OPENSSL_EXPORT void CBB_zero(CBB *cbb);
379 OPENSSL_EXPORT int CBB_init(CBB *cbb, size_t initial_capacity);
384 OPENSSL_EXPORT int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len);
393 OPENSSL_EXPORT void CBB_cleanup(CBB *cbb);
403 OPENSSL_EXPORT int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len);
410 OPENSSL_EXPORT int CBB_flush(CBB *cbb);
417 OPENSSL_EXPORT const uint8_t *CBB_data(const CBB *cbb);
424 OPENSSL_EXPORT size_t CBB_len(const CBB *cbb);
429 OPENSSL_EXPORT int CBB_add_u8_length_prefixed(CBB *cbb, CBB *out_contents);
434 OPENSSL_EXPORT int CBB_add_u16_length_prefixed(CBB *cbb, CBB *out_contents);
[all …]
/external/boringssl/src/include/openssl/
Dbytestring.h389 OPENSSL_EXPORT void CBB_zero(CBB *cbb);
394 OPENSSL_EXPORT int CBB_init(CBB *cbb, size_t initial_capacity);
399 OPENSSL_EXPORT int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len);
408 OPENSSL_EXPORT void CBB_cleanup(CBB *cbb);
418 OPENSSL_EXPORT int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len);
425 OPENSSL_EXPORT int CBB_flush(CBB *cbb);
432 OPENSSL_EXPORT const uint8_t *CBB_data(const CBB *cbb);
439 OPENSSL_EXPORT size_t CBB_len(const CBB *cbb);
444 OPENSSL_EXPORT int CBB_add_u8_length_prefixed(CBB *cbb, CBB *out_contents);
449 OPENSSL_EXPORT int CBB_add_u16_length_prefixed(CBB *cbb, CBB *out_contents);
[all …]
/external/boringssl/src/crypto/ecdsa_extra/
Decdsa_asn1.c83 CBB cbb; in ECDSA_sign() local
84 CBB_zero(&cbb); in ECDSA_sign()
86 if (!CBB_init_fixed(&cbb, sig, ECDSA_size(eckey)) || in ECDSA_sign()
87 !ECDSA_SIG_marshal(&cbb, s) || in ECDSA_sign()
88 !CBB_finish(&cbb, NULL, &len)) { in ECDSA_sign()
90 CBB_cleanup(&cbb); in ECDSA_sign()
181 int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig) { in ECDSA_SIG_marshal() argument
183 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in ECDSA_SIG_marshal()
186 !CBB_flush(cbb)) { in ECDSA_SIG_marshal()
195 CBB cbb; in ECDSA_SIG_to_bytes() local
[all …]
/external/rust/crates/quiche/deps/boringssl/src/crypto/ecdsa_extra/
Decdsa_asn1.c83 CBB cbb; in ECDSA_sign() local
84 CBB_zero(&cbb); in ECDSA_sign()
86 if (!CBB_init_fixed(&cbb, sig, ECDSA_size(eckey)) || in ECDSA_sign()
87 !ECDSA_SIG_marshal(&cbb, s) || in ECDSA_sign()
88 !CBB_finish(&cbb, NULL, &len)) { in ECDSA_sign()
90 CBB_cleanup(&cbb); in ECDSA_sign()
181 int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig) { in ECDSA_SIG_marshal() argument
183 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in ECDSA_SIG_marshal()
186 !CBB_flush(cbb)) { in ECDSA_SIG_marshal()
195 CBB cbb; in ECDSA_SIG_to_bytes() local
[all …]
/external/rust/crates/quiche/deps/boringssl/src/crypto/dh/
Ddh_asn1.c77 static int marshal_integer(CBB *cbb, BIGNUM *bn) { in marshal_integer() argument
83 return BN_marshal_asn1(cbb, bn); in marshal_integer()
120 int DH_marshal_parameters(CBB *cbb, const DH *dh) { in DH_marshal_parameters() argument
122 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DH_marshal_parameters()
127 !CBB_flush(cbb)) { in DH_marshal_parameters()
153 CBB cbb; in i2d_DHparams() local
154 if (!CBB_init(&cbb, 0) || in i2d_DHparams()
155 !DH_marshal_parameters(&cbb, in)) { in i2d_DHparams()
156 CBB_cleanup(&cbb); in i2d_DHparams()
159 return CBB_finish_i2d(&cbb, outp); in i2d_DHparams()
/external/boringssl/src/crypto/dh_extra/
Ddh_asn1.c77 static int marshal_integer(CBB *cbb, BIGNUM *bn) { in marshal_integer() argument
83 return BN_marshal_asn1(cbb, bn); in marshal_integer()
120 int DH_marshal_parameters(CBB *cbb, const DH *dh) { in DH_marshal_parameters() argument
122 if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) || in DH_marshal_parameters()
127 !CBB_flush(cbb)) { in DH_marshal_parameters()
153 CBB cbb; in i2d_DHparams() local
154 if (!CBB_init(&cbb, 0) || in i2d_DHparams()
155 !DH_marshal_parameters(&cbb, in)) { in i2d_DHparams()
156 CBB_cleanup(&cbb); in i2d_DHparams()
159 return CBB_finish_i2d(&cbb, outp); in i2d_DHparams()
/external/rust/crates/quiche/deps/boringssl/src/crypto/trust_token/
Dpmbtoken.c249 pmbtoken_blind(const PMBTOKEN_METHOD *method, CBB *cbb, size_t count) { in STACK_OF()
292 if (!CBB_add_u16_length_prefixed(cbb, &child) || in STACK_OF()
294 !CBB_flush(cbb)) { in STACK_OF()
337 CBB cbb; in hash_c_dleq() local
338 CBB_zero(&cbb); in hash_c_dleq()
341 if (!CBB_init(&cbb, 0) || in hash_c_dleq()
342 !CBB_add_bytes(&cbb, kDLEQ2Label, sizeof(kDLEQ2Label)) || in hash_c_dleq()
343 !point_to_cbb(&cbb, method->group, X) || in hash_c_dleq()
344 !point_to_cbb(&cbb, method->group, T) || in hash_c_dleq()
345 !point_to_cbb(&cbb, method->group, S) || in hash_c_dleq()
[all …]
/external/boringssl/src/crypto/trust_token/
Dpmbtoken.c269 pmbtoken_blind(const PMBTOKEN_METHOD *method, CBB *cbb, size_t count) { in STACK_OF()
309 if (!cbb_add_prefixed_point(cbb, group, &pretoken->Tp, in STACK_OF()
353 CBB cbb; in hash_c_dleq() local
354 CBB_zero(&cbb); in hash_c_dleq()
357 if (!CBB_init(&cbb, 0) || in hash_c_dleq()
358 !CBB_add_bytes(&cbb, kDLEQ2Label, sizeof(kDLEQ2Label)) || in hash_c_dleq()
359 !point_to_cbb(&cbb, method->group, X) || in hash_c_dleq()
360 !point_to_cbb(&cbb, method->group, T) || in hash_c_dleq()
361 !point_to_cbb(&cbb, method->group, S) || in hash_c_dleq()
362 !point_to_cbb(&cbb, method->group, W) || in hash_c_dleq()
[all …]
Dvoprf.c167 voprf_blind(const VOPRF_METHOD *method, CBB *cbb, size_t count) { in STACK_OF()
211 if (!cbb_add_point(cbb, group, &pretoken->Tp)) { in STACK_OF()
230 CBB cbb; in hash_to_scalar_dleq() local
231 CBB_zero(&cbb); in hash_to_scalar_dleq()
234 if (!CBB_init(&cbb, 0) || in hash_to_scalar_dleq()
235 !CBB_add_bytes(&cbb, kDLEQLabel, sizeof(kDLEQLabel)) || in hash_to_scalar_dleq()
236 !cbb_add_point(&cbb, method->group, X) || in hash_to_scalar_dleq()
237 !cbb_add_point(&cbb, method->group, T) || in hash_to_scalar_dleq()
238 !cbb_add_point(&cbb, method->group, W) || in hash_to_scalar_dleq()
239 !cbb_add_point(&cbb, method->group, K0) || in hash_to_scalar_dleq()
[all …]
/external/boringssl/src/ssl/
Dtls13_both.cc59 ScopedCBB cbb; in tls13_get_cert_verify_signature_input() local
60 if (!CBB_init(cbb.get(), 64 + 33 + 1 + 2 * EVP_MAX_MD_SIZE)) { in tls13_get_cert_verify_signature_input()
66 if (!CBB_add_u8(cbb.get(), 0x20)) { in tls13_get_cert_verify_signature_input()
88 if (!CBB_add_bytes(cbb.get(), in tls13_get_cert_verify_signature_input()
98 !CBB_add_bytes(cbb.get(), context_hash, context_hash_len) || in tls13_get_cert_verify_signature_input()
99 !CBBFinishArray(cbb.get(), out)) { in tls13_get_cert_verify_signature_input()
417 ScopedCBB cbb; in tls13_add_certificate() local
421 if (!CBB_init(cbb.get(), 1024)) { in tls13_add_certificate()
424 body = cbb.get(); in tls13_add_certificate()
427 if (!ssl->method->init_message(ssl, cbb.get(), body, SSL3_MT_CERTIFICATE)) { in tls13_add_certificate()
[all …]
Dd1_both.cc153 ScopedCBB cbb; in dtls1_hm_fragment_new() local
170 if (!CBB_init_fixed(cbb.get(), frag->data, DTLS1_HM_HEADER_LENGTH) || in dtls1_hm_fragment_new()
171 !CBB_add_u8(cbb.get(), msg_hdr->type) || in dtls1_hm_fragment_new()
172 !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || in dtls1_hm_fragment_new()
173 !CBB_add_u16(cbb.get(), msg_hdr->seq) || in dtls1_hm_fragment_new()
174 !CBB_add_u24(cbb.get(), 0 /* frag_off */) || in dtls1_hm_fragment_new()
175 !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || in dtls1_hm_fragment_new()
176 !CBB_finish(cbb.get(), NULL, NULL)) { in dtls1_hm_fragment_new()
506 bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type) { in dtls1_init_message() argument
508 if (!CBB_init(cbb, 64) || in dtls1_init_message()
[all …]
/external/rust/crates/quiche/deps/boringssl/src/ssl/
Dtls13_both.cc59 ScopedCBB cbb; in tls13_get_cert_verify_signature_input() local
60 if (!CBB_init(cbb.get(), 64 + 33 + 1 + 2 * EVP_MAX_MD_SIZE)) { in tls13_get_cert_verify_signature_input()
66 if (!CBB_add_u8(cbb.get(), 0x20)) { in tls13_get_cert_verify_signature_input()
88 if (!CBB_add_bytes(cbb.get(), in tls13_get_cert_verify_signature_input()
98 !CBB_add_bytes(cbb.get(), context_hash, context_hash_len) || in tls13_get_cert_verify_signature_input()
99 !CBBFinishArray(cbb.get(), out)) { in tls13_get_cert_verify_signature_input()
418 ScopedCBB cbb; in tls13_add_certificate() local
422 if (!CBB_init(cbb.get(), 1024)) { in tls13_add_certificate()
425 body = cbb.get(); in tls13_add_certificate()
428 if (!ssl->method->init_message(ssl, cbb.get(), body, SSL3_MT_CERTIFICATE)) { in tls13_add_certificate()
[all …]
Dd1_both.cc153 ScopedCBB cbb; in dtls1_hm_fragment_new() local
170 if (!CBB_init_fixed(cbb.get(), frag->data, DTLS1_HM_HEADER_LENGTH) || in dtls1_hm_fragment_new()
171 !CBB_add_u8(cbb.get(), msg_hdr->type) || in dtls1_hm_fragment_new()
172 !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || in dtls1_hm_fragment_new()
173 !CBB_add_u16(cbb.get(), msg_hdr->seq) || in dtls1_hm_fragment_new()
174 !CBB_add_u24(cbb.get(), 0 /* frag_off */) || in dtls1_hm_fragment_new()
175 !CBB_add_u24(cbb.get(), msg_hdr->msg_len) || in dtls1_hm_fragment_new()
176 !CBB_finish(cbb.get(), NULL, NULL)) { in dtls1_hm_fragment_new()
506 bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type) { in dtls1_init_message() argument
508 if (!CBB_init(cbb, 64) || in dtls1_init_message()
[all …]
/external/rust/crates/quiche/deps/boringssl/src/fuzz/
Dpkcs8.cc30 CBB cbb; in LLVMFuzzerTestOneInput() local
31 if (CBB_init(&cbb, 0) && in LLVMFuzzerTestOneInput()
32 EVP_marshal_private_key(&cbb, pkey) && in LLVMFuzzerTestOneInput()
33 CBB_finish(&cbb, &der, &der_len)) { in LLVMFuzzerTestOneInput()
36 CBB_cleanup(&cbb); in LLVMFuzzerTestOneInput()
Dspki.cc31 CBB cbb; in LLVMFuzzerTestOneInput() local
32 if (CBB_init(&cbb, 0) && in LLVMFuzzerTestOneInput()
33 EVP_marshal_public_key(&cbb, pkey) && in LLVMFuzzerTestOneInput()
34 CBB_finish(&cbb, &der, &der_len)) { in LLVMFuzzerTestOneInput()
37 CBB_cleanup(&cbb); in LLVMFuzzerTestOneInput()

12345678