/crypto/bn/ |
A D | convert.cc | 125 l += in[i] - '0'; in decode_dec() 146 if (in == NULL || *in == 0) { in bn_x2bn() 150 if (*in == '-') { in bn_x2bn() 152 in++; in bn_x2bn() 174 if (!decode(ret, in, i)) { in bn_x2bn() 255 if (*in == '-') { in BN_asc2bn() 256 in++; in BN_asc2bn() 259 if (in[0] == '0' && (in[1] == 'X' || in[1] == 'x')) { in BN_asc2bn() 264 if (!BN_dec2bn(outp, in)) { in BN_asc2bn() 345 if (in->neg && len > 0) { in BN_bn2mpi() [all …]
|
/crypto/fipsmodule/aes/ |
A D | internal.h | 35 typedef void (*block128_f)(const uint8_t in[16], uint8_t out[16], 39 typedef void (*ctr128_f)(const uint8_t *in, uint8_t *out, size_t blocks, 95 void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, 142 inline void aes_hw_encrypt(const uint8_t *in, uint8_t *out, in aes_hw_encrypt() argument 147 inline void aes_hw_decrypt(const uint8_t *in, uint8_t *out, in aes_hw_decrypt() argument 167 void aes_hw_ecb_encrypt(const uint8_t *in, uint8_t *out, size_t length, 174 void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, 222 void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, 264 void aes_nohw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, 449 const uint8_t *in, size_t len); [all …]
|
A D | cbc.cc.inc | 27 // Avoid |ivec| == |iv| in the |memcpy| below, which is not legal in C. 39 in += 16; 56 in += 16; 68 // Avoid |ivec| == |iv| in the |memcpy| below, which is not legal in C. 76 // If |in| and |out| alias, |in| must be ahead. 88 iv = in; 90 in += 16; 107 in += 16; 116 c = in[n]; 122 ivec[n] = in[n]; [all …]
|
A D | mode_wrappers.cc.inc | 4 // you may not use this file except in compliance with the License. 9 // Unless required by applicable law or agreed to in writing, software 24 BCM_aes_encrypt(in, out, key); 28 BCM_aes_decrypt(in, out, key); 53 assert(in && out && key); 57 BCM_aes_encrypt(in, out, key); 59 BCM_aes_decrypt(in, out, key); 68 aes_hw_cbc_encrypt(in, out, len, key, ivec, enc); 70 aes_nohw_cbc_encrypt(in, out, len, key, ivec, enc); 72 CRYPTO_cbc128_encrypt(in, out, len, key, ivec, aes_encrypt); [all …]
|
A D | cfb.cc.inc | 26 assert(in && out && key && ivec && num); 32 *(out++) = ivec[n] ^= *(in++); 46 in += 16; 52 out[n] = ivec[n] ^= in[n]; 61 *(out++) = ivec[n] ^ (c = *(in++)); 75 in += 16; 82 out[n] = ivec[n] ^ (c = in[n]); 114 out[n] = (ovec[16 + n] = in[n] ^ ivec[n]); 119 out[n] = (ovec[16 + n] = in[n]) ^ ivec[n]; 143 assert(in && out && key && ivec && num); [all …]
|
A D | aes.cc.inc | 4 // you may not use this file except in compliance with the License. 26 bcm_infallible BCM_aes_encrypt(const uint8_t *in, uint8_t *out, 29 aes_hw_encrypt(in, out, key); 31 vpaes_encrypt(in, out, key); 33 aes_nohw_encrypt(in, out, key); 41 aes_hw_decrypt(in, out, key); 43 vpaes_decrypt(in, out, key); 45 aes_nohw_decrypt(in, out, key); 116 CRYPTO_xor16(out, in, enc); 118 in += 16; [all …]
|
/crypto/x509/ |
A D | x509cset.cc | 58 ASN1_TIME *in; in X509_CRL_set1_lastUpdate() local 64 if (in != tm) { in X509_CRL_set1_lastUpdate() 66 if (in != NULL) { in X509_CRL_set1_lastUpdate() 71 return in != NULL; in X509_CRL_set1_lastUpdate() 75 ASN1_TIME *in; in X509_CRL_set1_nextUpdate() local 81 if (in != tm) { in X509_CRL_set1_nextUpdate() 83 if (in != NULL) { in X509_CRL_set1_nextUpdate() 88 return in != NULL; in X509_CRL_set1_nextUpdate() 153 ASN1_TIME *in; in X509_REVOKED_set_revocationDate() local 159 if (in != tm) { in X509_REVOKED_set_revocationDate() [all …]
|
A D | x509_set.cc | 64 ASN1_INTEGER *in; in X509_set_serialNumber() local 69 if (in != serial) { in X509_set_serialNumber() 71 if (in != NULL) { in X509_set_serialNumber() 76 return in != NULL; in X509_set_serialNumber() 94 ASN1_TIME *in; in X509_set1_notBefore() local 100 if (in != tm) { in X509_set1_notBefore() 102 if (in != NULL) { in X509_set1_notBefore() 107 return in != NULL; in X509_set1_notBefore() 133 ASN1_TIME *in; in X509_set1_notAfter() local 139 if (in != tm) { in X509_set1_notAfter() [all …]
|
A D | by_file.cc | 58 BIO *in = NULL; in X509_load_cert_file() local 62 in = BIO_new(BIO_s_file()); in X509_load_cert_file() 64 if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) { in X509_load_cert_file() 113 BIO_free(in); in X509_load_cert_file() 119 BIO *in = NULL; in X509_load_crl_file() local 123 in = BIO_new(BIO_s_file()); in X509_load_crl_file() 125 if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) { in X509_load_crl_file() 174 BIO_free(in); in X509_load_crl_file() 181 BIO *in; in X509_load_cert_crl_file() local 189 if (!in) { in X509_load_cert_crl_file() [all …]
|
/crypto/fipsmodule/ec/ |
A D | p224-64.cc.inc | 196 // if in > p , reduce in = in - 2^224 + 2^96 - 1 209 a = ((in[3] & in[2] & (in[1] | 0x000000ffffffffff)) + 1) | 291 // Subtract in unreduced 128-bit mode: out -= in 320 // in[i] < 2^63 370 out[0] = ((p224_widelimb)in[0]) * in[0]; 372 out[2] = ((p224_widelimb)in[0]) * tmp2 + ((p224_widelimb)in[1]) * in[1]; 374 out[4] = ((p224_widelimb)in[3]) * tmp1 + ((p224_widelimb)in[2]) * in[2]; 376 out[6] = ((p224_widelimb)in[3]) * in[3]; 414 // Eliminate in[4], in[5], in[6] 472 p224_limb zero = in[0] | in[1] | in[2] | in[3]; [all …]
|
/crypto/poly1305/ |
A D | poly1305_test.cc | 40 if (todo > in.size()) { in TestSIMD() 41 todo = in.size(); in TestSIMD() 55 if (done + excess > in.size()) { in TestSIMD() 63 CRYPTO_poly1305_update(&state, in.data() + done, in.size() - done); in TestSIMD() 72 std::vector<uint8_t> key, in, mac; in TEST() local 82 CRYPTO_poly1305_update(&state, in.data(), in.size()); in TEST() 100 CRYPTO_poly1305_update(&state, in.data(), in.size()); in TEST() 108 TestSIMD(0, key, in, mac); in TEST() 109 TestSIMD(16, key, in, mac); in TEST() 110 TestSIMD(32, key, in, mac); in TEST() [all …]
|
/crypto/ |
A D | constant_time_test.cc | 145 uint8_t out[256], in[256]; in TEST() local 147 RAND_bytes(in, sizeof(in)); in TEST() 154 OPENSSL_memcpy(ref_in, in, sizeof(in)); in TEST() 159 OPENSSL_memcpy(ref_out, in, sizeof(in)); in TEST() 163 CONSTTIME_SECRET(in, sizeof(in)); in TEST() 168 CONSTTIME_DECLASSIFY(&in, sizeof(in)); in TEST() 180 RAND_bytes(in, sizeof(in)); in TEST() 187 OPENSSL_memcpy(ref_in, in, sizeof(in)); in TEST() 193 ref_out[j] ^= in[j]; in TEST() 198 CONSTTIME_SECRET(in, sizeof(in)); in TEST() [all …]
|
/crypto/fipsmodule/bn/ |
A D | bytes.cc.inc | 40 word = (word << 8) | in[i]; 98 // Reserve enough space in |ret|. 111 OPENSSL_memcpy(ret->d, in, len); 116 return BN_lebin2bn(in, len, ret); 120 // represented in |num_bytes| bytes. 165 size_t n = BN_num_bytes(in); 166 bn_words_to_big_endian(out, n, in->d, in->width); 171 if (!fits_in_bytes(in->d, in->width, len)) { 178 size_t num_bytes = in->width * BN_BYTES; 190 if (!fits_in_bytes(in->d, in->width, len)) { [all …]
|
/crypto/fipsmodule/digest/ |
A D | md32_common.h | 81 if (in.empty()) { in crypto_md32_update() 95 if (in.size() >= Traits::kBlockSize || in crypto_md32_update() 96 in.size() + n >= Traits::kBlockSize) { in crypto_md32_update() 99 in = in.subspan(Traits::kBlockSize - n); in crypto_md32_update() 104 OPENSSL_memcpy(ctx->data + n, in.data(), in.size()); in crypto_md32_update() 110 n = in.size() / Traits::kBlockSize; in crypto_md32_update() 112 Traits::HashBlocks(ctx->h, in.data(), n); in crypto_md32_update() 113 in = in.subspan(n * Traits::kBlockSize); in crypto_md32_update() 116 if (!in.empty()) { in crypto_md32_update() 117 ctx->num = static_cast<unsigned>(in.size()); in crypto_md32_update() [all …]
|
A D | digest.cc.inc | 96 if (in == NULL || (in->pctx == NULL && in->digest == NULL)) { 100 if (out == in) { 106 assert(in->pctx == NULL || in->pctx_ops != NULL); 107 if (in->pctx) { 108 pctx = in->pctx_ops->dup(in->pctx); 116 out->digest = in->digest; 117 if (in->digest != NULL) { 118 OPENSSL_memcpy(out->md_data, in->md_data, in->digest->ctx_size); 121 out->pctx_ops = in->pctx_ops; 135 EVP_MD_CTX_init(in); [all …]
|
/crypto/cipher/ |
A D | e_aeseax.cc | 48 const crypto_word_t in_hi = CRYPTO_load_word_be(in); in mult_by_X() 50 out[i] = (in[i] << 1) | (in[i + 1] >> 7); in mult_by_X() 99 CRYPTO_xor16(out, in, out); in cbk_block() 108 CRYPTO_xor16(out, aes_ctx->b, in); in pad() 112 OPENSSL_memcpy(out, in, in_len); in pad() 129 cbk_block(aes_ctx, in, out); in omac() 130 in += AES_BLOCK_SIZE; in omac() 135 pad(aes_ctx, padded_block, in, in_len); in omac() 144 omac(aes_ctx, out, in, in_len); in omac_with_tag() 191 aes_ctr(aes_ctx, out, n, in, in_len); in aead_aes_eax_seal_scatter() [all …]
|
A D | e_aesgcmsiv.cc | 97 extern void aes128gcmsiv_dec(const uint8_t *in, uint8_t *out, 104 extern void aes256gcmsiv_dec(const uint8_t *in, uint8_t *out, 139 const uint8_t in[16], uint8_t out[16], 145 const uint8_t in[16], uint8_t out[16], 261 OPENSSL_memcpy(scratch, &in[in_len & ~15], in_len & 15); in gcm_siv_asm_polyval() 299 const uint8_t *last_bytes_in = &in[last_bytes_offset]; in aead_aes_gcm_siv_asm_crypt_last_block() 362 gcm_siv_asm_polyval(tag, in, in_len, ad, ad_len, in aead_aes_gcm_siv_asm_seal_scatter() 609 out[done + i] = keystream[i] ^ in[done + i]; in gcm_siv_crypt() 679 OPENSSL_memcpy(buf, in, todo); in crypto_polyval_update_blocks() 680 in += todo; in crypto_polyval_update_blocks() [all …]
|
A D | e_chacha20poly1305.cc | 166 OPENSSL_memcpy(data.in.key, key, 32); in chacha20_poly1305_seal_scatter() 167 data.in.counter = 0; in chacha20_poly1305_seal_scatter() 168 OPENSSL_memcpy(data.in.nonce, nonce, 12); in chacha20_poly1305_seal_scatter() 169 data.in.extra_ciphertext = out_tag; in chacha20_poly1305_seal_scatter() 170 data.in.extra_ciphertext_len = extra_in_len; in chacha20_poly1305_seal_scatter() 171 chacha20_poly1305_seal(out, in, in_len, ad, ad_len, &data); in chacha20_poly1305_seal_scatter() 173 CRYPTO_chacha_20(out, in, in_len, key, nonce, 1); in chacha20_poly1305_seal_scatter() 249 OPENSSL_memcpy(data.in.key, key, 32); in chacha20_poly1305_open_gather() 250 data.in.counter = 0; in chacha20_poly1305_open_gather() 251 OPENSSL_memcpy(data.in.nonce, nonce, 12); in chacha20_poly1305_open_gather() [all …]
|
/crypto/bytestring/ |
A D | ber.cc | 60 CBS in = *orig_in; in cbs_find_ber() local 63 while (CBS_len(&in) > 0) { in cbs_find_ber() 120 while (CBS_len(in) > 0) { in cbs_convert_ber() 121 if (looking_for_eoc && cbs_get_eoc(in)) { in cbs_convert_ber() 198 if (!cbs_find_ber(in, &conversion_needed, 0)) { in CBS_asn1_ber_to_der() 203 if (!CBS_get_any_asn1_element(in, out, NULL, NULL)) { in CBS_asn1_ber_to_der() 211 if (!CBB_init(&cbb, CBS_len(in)) || in CBS_asn1_ber_to_der() 212 !cbs_convert_ber(in, &cbb, 0, 0, 0) || in CBS_asn1_ber_to_der() 229 if (CBS_peek_asn1_tag(in, outer_tag)) { in CBS_get_asn1_implicit_string() 232 return CBS_get_asn1(in, out, outer_tag); in CBS_get_asn1_implicit_string() [all …]
|
/crypto/fipsmodule/cmac/ |
A D | cmac.cc.inc | 53 const uint8_t *in, size_t in_len) { 111 out->block_used = in->block_used; 122 // Shift |in| to left, including carry. 124 out[i] = (in[i] << 1) | (in[i + 1] >> 7); 128 const uint8_t carry = in[0] >> 7; 139 // Shift |in| to left, including carry. 141 out[i] = (in[i] << 1) | (in[i + 1] >> 7); 145 const uint8_t carry = in[0] >> 7; 209 in += todo; 235 in += block_size; [all …]
|
/crypto/test/ |
A D | test_util.cc | 25 const uint8_t *data = reinterpret_cast<const uint8_t*>(in); in hexdump() 35 if (in.span_.empty()) { in operator <<() 40 os << EncodeHex(in.span_); in operator <<() 46 if (in.size() % 2 != 0) { in DecodeHex() 49 out->reserve(in.size() / 2); in DecodeHex() 50 for (size_t i = 0; i < in.size(); i += 2) { in DecodeHex() 52 if (!OPENSSL_fromxdigit(&hi, in[i]) || in DecodeHex() 53 !OPENSSL_fromxdigit(&lo, in[i + 1])) { in DecodeHex() 61 std::string EncodeHex(bssl::Span<const uint8_t> in) { in EncodeHex() argument 64 ret.reserve(in.size() * 2); in EncodeHex() [all …]
|
/crypto/asn1/ |
A D | tasn_dec.cc | 206 p = *in; in asn1_item_ex_d2i() 422 if (!asn1_enc_save(pval, *in, p - *in, it, buf)) { in asn1_item_ex_d2i() 470 p = *in; in asn1_template_ex_d2i() 507 *in = p; in asn1_template_ex_d2i() 527 p = *in; in asn1_template_noexp_d2i() 607 *in = p; in asn1_template_noexp_d2i() 649 p = *in; in asn1_d2i_ex_primitive() 694 p = *in; in asn1_d2i_ex_primitive() 733 *in = p; in asn1_d2i_ex_primitive() 927 p = *in; in asn1_check_tlen() [all …]
|
/crypto/hrss/ |
A D | hrss.cc | 313 in = ((in >> (1 << i)) & kMasks[i]) | ((in & kMasks[i]) << (1 << i)); in word_reverse() 316 return in; in word_reverse() 1604 p[0] = (uint16_t)(in[0]) | (uint16_t)(in[1] & 0x1f) << 8; in poly_unmarshal() 1605 p[1] = (uint16_t)(in[1] >> 5) | (uint16_t)(in[2]) << 3 | in poly_unmarshal() 1608 p[3] = (uint16_t)(in[4] >> 7) | (uint16_t)(in[5]) << 1 | in poly_unmarshal() 1610 p[4] = (uint16_t)(in[6] >> 4) | (uint16_t)(in[7]) << 4 | in poly_unmarshal() 1613 p[6] = (uint16_t)(in[9] >> 6) | (uint16_t)(in[10]) << 2 | in poly_unmarshal() 1618 in += 13; in poly_unmarshal() 1622 p[0] = (uint16_t)(in[0]) | (uint16_t)(in[1] & 0x1f) << 8; in poly_unmarshal() 1623 p[1] = (uint16_t)(in[1] >> 5) | (uint16_t)(in[2]) << 3 | in poly_unmarshal() [all …]
|
/crypto/base64/ |
A D | base64.cc | 93 const uint8_t *in, size_t in_len) { in EVP_EncodeUpdate() argument 112 in += todo; in EVP_EncodeUpdate() 127 in += sizeof(ctx->data); in EVP_EncodeUpdate() 143 OPENSSL_memcpy(ctx->data, in, in_len); in EVP_EncodeUpdate() 250 const uint8_t *in) { in base64_decode_quad() argument 251 const uint8_t a = base64_ascii_to_bin(in[0]); in base64_decode_quad() 252 const uint8_t b = base64_ascii_to_bin(in[1]); in base64_decode_quad() 253 const uint8_t c = base64_ascii_to_bin(in[2]); in base64_decode_quad() 254 const uint8_t d = base64_ascii_to_bin(in[3]); in base64_decode_quad() 265 (in[3] == '='); in base64_decode_quad() [all …]
|
/crypto/des/ |
A D | des.cc | 347 const uint8_t *in; in DES_set_key_ex() local 350 in = key; in DES_set_key_ex() 352 c2l(in, c); in DES_set_key_ex() 353 c2l(in, d); in DES_set_key_ex() 624 c2l(in, tin0); in DES_ncbc_encrypt_ex() 625 c2l(in, tin1); in DES_ncbc_encrypt_ex() 655 c2l(in, tin0); in DES_ncbc_encrypt_ex() 657 c2l(in, tin1); in DES_ncbc_encrypt_ex() 668 c2l(in, tin0); in DES_ncbc_encrypt_ex() 670 c2l(in, tin1); in DES_ncbc_encrypt_ex() [all …]
|