/freebsd/crypto/openssl/crypto/evp/ |
H A D | e_des3.c | 70 const unsigned char *in, size_t inl) in des_ede_ecb_cipher() argument 81 const unsigned char *in, size_t inl) in des_ede_ofb_cipher() argument 83 while (inl >= EVP_MAXCHUNK) { in des_ede_ofb_cipher() 91 inl -= EVP_MAXCHUNK; in des_ede_ofb_cipher() 95 if (inl) { in des_ede_ofb_cipher() 97 DES_ede3_ofb64_encrypt(in, out, (long)inl, in des_ede_ofb_cipher() 108 const unsigned char *in, size_t inl) in des_ede_cbc_cipher() argument 113 (*dat->stream.cbc) (in, out, inl, dat->ks.ks, in des_ede_cbc_cipher() 118 while (inl >= EVP_MAXCHUNK) { in des_ede_cbc_cipher() 123 inl -= EVP_MAXCHUNK; in des_ede_cbc_cipher() [all …]
|
H A D | e_des.c | 61 const unsigned char *in, size_t inl) in des_ecb_cipher() argument 71 const unsigned char *in, size_t inl) in des_ofb_cipher() argument 73 while (inl >= EVP_MAXCHUNK) { in des_ofb_cipher() 79 inl -= EVP_MAXCHUNK; in des_ofb_cipher() 83 if (inl) { in des_ofb_cipher() 85 DES_ofb64_encrypt(in, out, (long)inl, in des_ofb_cipher() 94 const unsigned char *in, size_t inl) in des_cbc_cipher() argument 99 (*dat->stream.cbc) (in, out, inl, &dat->ks.ks, ctx->iv); in des_cbc_cipher() 102 while (inl >= EVP_MAXCHUNK) { in des_cbc_cipher() 107 inl -= EVP_MAXCHUNK; in des_cbc_cipher() [all …]
|
H A D | encode.c | 163 const unsigned char *in, int inl) in EVP_EncodeUpdate() argument 169 if (inl <= 0) in EVP_EncodeUpdate() 172 if (ctx->length - ctx->num > inl) { in EVP_EncodeUpdate() 173 memcpy(&(ctx->enc_data[ctx->num]), in, inl); in EVP_EncodeUpdate() 174 ctx->num += inl; in EVP_EncodeUpdate() 181 inl -= i; in EVP_EncodeUpdate() 192 while (inl >= ctx->length && total <= INT_MAX) { in EVP_EncodeUpdate() 195 inl -= ctx->length; in EVP_EncodeUpdate() 209 if (inl != 0) in EVP_EncodeUpdate() 210 memcpy(&(ctx->enc_data[0]), in, inl); in EVP_EncodeUpdate() [all …]
|
H A D | e_xcbc_d.c | 30 const unsigned char *in, size_t inl); 73 const unsigned char *in, size_t inl) in desx_cbc_cipher() argument 75 while (inl >= EVP_MAXCHUNK) { in desx_cbc_cipher() 80 inl -= EVP_MAXCHUNK; in desx_cbc_cipher() 84 if (inl) in desx_cbc_cipher() 85 DES_xcbc_encrypt(in, out, (long)inl, &data(ctx)->ks, in desx_cbc_cipher()
|
H A D | evp_enc.c | 457 const unsigned char *in, int inl) in EVP_CipherUpdate() argument 460 return EVP_EncryptUpdate(ctx, out, outl, in, inl); in EVP_CipherUpdate() 462 return EVP_DecryptUpdate(ctx, out, outl, in, inl); in EVP_CipherUpdate() 560 const unsigned char *in, int inl) in evp_EncryptDecryptUpdate() argument 562 int i, j, bl, cmpl = inl; in evp_EncryptDecryptUpdate() 576 i = ctx->cipher->do_cipher(ctx, out, in, inl); in evp_EncryptDecryptUpdate() 584 if (inl <= 0) { in evp_EncryptDecryptUpdate() 586 return inl == 0; in evp_EncryptDecryptUpdate() 593 if (ctx->buf_len == 0 && (inl & (ctx->block_mask)) == 0) { in evp_EncryptDecryptUpdate() 594 if (ctx->cipher->do_cipher(ctx, out, in, inl)) { in evp_EncryptDecryptUpdate() [all …]
|
/freebsd/crypto/openssl/providers/implementations/ciphers/ |
H A D | cipher_tdes_wrap.c | 36 const unsigned char *in, size_t inl) in des_ede3_unwrap() argument 41 if (inl < 24) in des_ede3_unwrap() 44 return inl - 16; in des_ede3_unwrap() 55 memmove(out, out + 8, inl - 8); in des_ede3_unwrap() 58 ctx->hw->cipher(ctx, out, in + 8, inl - 16); in des_ede3_unwrap() 60 ctx->hw->cipher(ctx, iv, in + inl - 8, 8); in des_ede3_unwrap() 63 BUF_reverse(out, NULL, inl - 16); in des_ede3_unwrap() 66 ctx->hw->cipher(ctx, out, out, inl - 16); in des_ede3_unwrap() 68 if (ossl_sha1(out, inl - 16, sha1tmp) /* Work out hash of first portion */ in des_ede3_unwrap() 70 rv = inl - 16; in des_ede3_unwrap() [all …]
|
H A D | ciphercommon_hw.c | 133 const unsigned char *in, size_t inl) in ossl_cipher_hw_chunked_cbc() argument 135 while (inl >= MAXCHUNK) { in ossl_cipher_hw_chunked_cbc() 137 inl -= MAXCHUNK; in ossl_cipher_hw_chunked_cbc() 141 if (inl > 0) in ossl_cipher_hw_chunked_cbc() 142 ossl_cipher_hw_generic_cbc(ctx, out, in, inl); in ossl_cipher_hw_chunked_cbc() 147 const unsigned char *in, size_t inl) in ossl_cipher_hw_chunked_cfb8() argument 151 if (inl < chunk) in ossl_cipher_hw_chunked_cfb8() 152 chunk = inl; in ossl_cipher_hw_chunked_cfb8() 153 while (inl > 0 && inl >= chunk) { in ossl_cipher_hw_chunked_cfb8() 154 ossl_cipher_hw_generic_cfb8(ctx, out, in, inl); in ossl_cipher_hw_chunked_cfb8() [all …]
|
H A D | cipher_tdes_default_hw.c | 49 const unsigned char *in, size_t inl) in ossl_cipher_hw_tdes_ofb() argument 54 while (inl >= MAXCHUNK) { in ossl_cipher_hw_tdes_ofb() 57 inl -= MAXCHUNK; in ossl_cipher_hw_tdes_ofb() 61 if (inl > 0) { in ossl_cipher_hw_tdes_ofb() 62 DES_ede3_ofb64_encrypt(in, out, (long)inl, &tctx->ks1, &tctx->ks2, in ossl_cipher_hw_tdes_ofb() 70 const unsigned char *in, size_t inl) in ossl_cipher_hw_tdes_cfb() argument 75 while (inl >= MAXCHUNK) { in ossl_cipher_hw_tdes_cfb() 80 inl -= MAXCHUNK; in ossl_cipher_hw_tdes_cfb() 84 if (inl > 0) { in ossl_cipher_hw_tdes_cfb() 85 DES_ede3_cfb64_encrypt(in, out, (long)inl, in ossl_cipher_hw_tdes_cfb() [all …]
|
H A D | ciphercommon.c | 249 const unsigned char *in, size_t inl) in ossl_cipher_generic_block_update() argument 270 || outsize < inl in ossl_cipher_generic_block_update() 282 padnum = blksz - (inl % blksz); in ossl_cipher_generic_block_update() 284 if (outsize < inl + padnum) { in ossl_cipher_generic_block_update() 296 memset(out + inl, 0, padnum - 1); in ossl_cipher_generic_block_update() 297 *(out + inl + padnum - 1) = padval; in ossl_cipher_generic_block_update() 300 for (loop = inl; loop < inl + padnum; loop++) in ossl_cipher_generic_block_update() 303 inl += padnum; in ossl_cipher_generic_block_update() 306 if ((inl % blksz) != 0) { in ossl_cipher_generic_block_update() 313 if (!ctx->hw->cipher(ctx, out, in, inl)) { in ossl_cipher_generic_block_update() [all …]
|
H A D | cipher_chacha20_hw.c | 42 const unsigned char *in, size_t inl) in chacha20_cipher() argument 49 while (inl > 0 && n < CHACHA_BLK_SIZE) { in chacha20_cipher() 51 inl--; in chacha20_cipher() 55 if (inl == 0) in chacha20_cipher() 66 rem = (unsigned int)(inl % CHACHA_BLK_SIZE); in chacha20_cipher() 67 inl -= rem; in chacha20_cipher() 69 while (inl >= CHACHA_BLK_SIZE) { in chacha20_cipher() 70 size_t blocks = inl / CHACHA_BLK_SIZE; in chacha20_cipher() 93 inl -= blocks; in chacha20_cipher()
|
H A D | cipher_des_hw.c | 135 const unsigned char *in, size_t inl) in cipher_hw_des_cfb1_cipher() argument 141 if (inl < chunk) in cipher_hw_des_cfb1_cipher() 142 chunk = inl; in cipher_hw_des_cfb1_cipher() 144 while (inl && inl >= chunk) { in cipher_hw_des_cfb1_cipher() 152 inl -= chunk; in cipher_hw_des_cfb1_cipher() 155 if (inl < chunk) in cipher_hw_des_cfb1_cipher() 156 chunk = inl; in cipher_hw_des_cfb1_cipher() 163 const unsigned char *in, size_t inl) in cipher_hw_des_cfb8_cipher() argument 167 while (inl >= MAXCHUNK) { in cipher_hw_des_cfb8_cipher() 170 inl -= MAXCHUNK; in cipher_hw_des_cfb8_cipher() [all …]
|
H A D | cipher_null.c | 66 size_t outsize, const unsigned char *in, size_t inl) in null_cipher() argument 78 if (inl < ctx->tlsmacsize) in null_cipher() 80 ctx->tlsmac = in + inl - ctx->tlsmacsize; in null_cipher() 81 inl -= ctx->tlsmacsize; in null_cipher() 83 if (outsize < inl) in null_cipher() 86 memcpy(out, in, inl); in null_cipher() 87 *outl = inl; in null_cipher()
|
H A D | cipher_tdes_hw.c | 59 const unsigned char *in, size_t inl) in ossl_cipher_hw_tdes_cbc() argument 64 (*tctx->tstream.cbc) (in, out, inl, tctx->tks.ks, ctx->iv); in ossl_cipher_hw_tdes_cbc() 68 while (inl >= MAXCHUNK) { in ossl_cipher_hw_tdes_cbc() 71 inl -= MAXCHUNK; in ossl_cipher_hw_tdes_cbc() 75 if (inl > 0) in ossl_cipher_hw_tdes_cbc() 76 DES_ede3_cbc_encrypt(in, out, (long)inl, &tctx->ks1, &tctx->ks2, in ossl_cipher_hw_tdes_cbc()
|
H A D | cipher_desx_hw.c | 51 const unsigned char *in, size_t inl) in cipher_hw_desx_cbc() argument 55 while (inl >= MAXCHUNK) { in cipher_hw_desx_cbc() 59 inl -= MAXCHUNK; in cipher_hw_desx_cbc() 63 if (inl > 0) in cipher_hw_desx_cbc() 64 DES_xcbc_encrypt(in, out, (long)inl, &tctx->ks1, in cipher_hw_desx_cbc()
|
H A D | cipher_aes_xts.c | 158 size_t outsize, const unsigned char *in, size_t inl) in aes_xts_cipher() argument 168 || inl < AES_BLOCK_SIZE) in aes_xts_cipher() 177 if (inl > XTS_MAX_BLOCKS_PER_DATA_UNIT * AES_BLOCK_SIZE) { in aes_xts_cipher() 183 (*ctx->stream)(in, out, inl, ctx->xts.key1, ctx->xts.key2, ctx->base.iv); in aes_xts_cipher() 184 else if (CRYPTO_xts128_encrypt(&ctx->xts, ctx->base.iv, in, out, inl, in aes_xts_cipher() 188 *outl = inl; in aes_xts_cipher() 194 size_t inl) in aes_xts_stream_update() argument 198 if (outsize < inl) { in aes_xts_stream_update() 203 if (!aes_xts_cipher(ctx, out, outl, outsize, in, inl)) { in aes_xts_stream_update()
|
H A D | cipher_cts.c | 330 size_t inl) in ossl_cipher_cbc_cts_block_update() argument 335 if (inl < CTS_BLOCK_SIZE) /* There must be at least one block for CTS mode */ in ossl_cipher_cbc_cts_block_update() 337 if (outsize < inl) in ossl_cipher_cbc_cts_block_update() 340 *outl = inl; in ossl_cipher_cbc_cts_block_update() 353 sz = cts128_cs1_encrypt(ctx, in, out, inl); in ossl_cipher_cbc_cts_block_update() 355 sz = cts128_cs2_encrypt(ctx, in, out, inl); in ossl_cipher_cbc_cts_block_update() 357 sz = cts128_cs3_encrypt(ctx, in, out, inl); in ossl_cipher_cbc_cts_block_update() 360 sz = cts128_cs1_decrypt(ctx, in, out, inl); in ossl_cipher_cbc_cts_block_update() 362 sz = cts128_cs2_decrypt(ctx, in, out, inl); in ossl_cipher_cbc_cts_block_update() 364 sz = cts128_cs3_decrypt(ctx, in, out, inl); in ossl_cipher_cbc_cts_block_update()
|
H A D | cipher_aes_ocb.c | 163 size_t inl, OSSL_ocb_cipher_fn ciph) in aes_ocb_block_update_internal() argument 169 nextblocks = ossl_cipher_fillblock(buf, bufsz, AES_BLOCK_SIZE, &in, &inl); in aes_ocb_block_update_internal() 171 nextblocks = inl & ~(AES_BLOCK_SIZE-1); in aes_ocb_block_update_internal() 198 inl -= nextblocks; in aes_ocb_block_update_internal() 200 if (inl != 0 in aes_ocb_block_update_internal() 201 && !ossl_cipher_trailingdata(buf, bufsz, AES_BLOCK_SIZE, &in, &inl)) { in aes_ocb_block_update_internal() 207 return inl == 0; in aes_ocb_block_update_internal() 233 size_t inl) in aes_ocb_block_update() argument 243 if (inl == 0) { in aes_ocb_block_update() 259 in, inl, fn); in aes_ocb_block_update() [all …]
|
/freebsd/crypto/openssl/crypto/asn1/ |
H A D | a_verify.c | 33 int ret = -1, i, inl; in ASN1_verify() local 51 inl = i2d(data, NULL); in ASN1_verify() 52 if (inl <= 0) { in ASN1_verify() 56 buf_in = OPENSSL_malloc((unsigned int)inl); in ASN1_verify() 65 && EVP_VerifyUpdate(ctx, (unsigned char *)buf_in, inl); in ASN1_verify() 67 OPENSSL_clear_free(buf_in, (unsigned int)inl); in ASN1_verify() 118 int ret = -1, inl = 0; in ASN1_item_verify_ctx() local 203 inl = ASN1_item_i2d(data, &buf_in, it); in ASN1_item_verify_ctx() 204 if (inl <= 0) { in ASN1_item_verify_ctx() 214 inll = inl; in ASN1_item_verify_ctx() [all …]
|
H A D | a_sign.c | 33 int i, inl = 0, outl = 0; in ASN1_sign() local 74 inl = i2d(data, NULL); in ASN1_sign() 75 if (inl <= 0) { in ASN1_sign() 79 inll = (size_t)inl; in ASN1_sign() 92 || !EVP_SignUpdate(ctx, (unsigned char *)buf_in, inl) in ASN1_sign() 158 size_t inl = 0, outl = 0, outll = 0; in ASN1_item_sign_ctx() local 268 inl = buf_len; in ASN1_item_sign_ctx() 269 if (!EVP_DigestSign(ctx, NULL, &outll, buf_in, inl)) { in ASN1_item_sign_ctx() 282 if (!EVP_DigestSign(ctx, buf_out, &outl, buf_in, inl)) { in ASN1_item_sign_ctx() 298 OPENSSL_clear_free((char *)buf_in, inl); in ASN1_item_sign_ctx()
|
H A D | a_digest.c | 31 int inl; in ASN1_digest() local 34 inl = i2d(data, NULL); in ASN1_digest() 35 if (inl <= 0) { in ASN1_digest() 39 if ((str = OPENSSL_malloc(inl)) == NULL) { in ASN1_digest() 46 if (!EVP_Digest(str, inl, md, len, type, NULL)) { in ASN1_digest()
|
H A D | bio_asn1.c | 154 static int asn1_bio_write(BIO *b, const char *in, int inl) in asn1_bio_write() argument 163 if (in == NULL || inl < 0 || ctx == NULL || next == NULL) in asn1_bio_write() 190 ctx->buflen = ASN1_object_size(0, inl, ctx->asn1_tag) - inl; in asn1_bio_write() 194 ASN1_put_object(&p, 0, inl, ctx->asn1_tag, ctx->asn1_class); in asn1_bio_write() 195 ctx->copylen = inl; in asn1_bio_write() 217 if (inl > ctx->copylen) in asn1_bio_write() 220 wrmax = inl; in asn1_bio_write() 227 inl -= ret; in asn1_bio_write() 232 if (inl == 0) in asn1_bio_write() 295 static int asn1_bio_read(BIO *b, char *in, int inl) in asn1_bio_read() argument [all …]
|
/freebsd/crypto/openssl/crypto/bio/ |
H A D | bf_lbuf.c | 108 static int linebuffer_write(BIO *b, const char *in, int inl) in linebuffer_write() argument 113 if ((in == NULL) || (inl <= 0)) in linebuffer_write() 125 for (p = in, c = '\0'; p < in + inl && (c = *p) != '\n'; p++) ; in linebuffer_write() 145 inl -= p - in; in linebuffer_write() 151 inl -= i; in linebuffer_write() 186 inl -= i; in linebuffer_write() 189 while (foundnl && inl > 0); in linebuffer_write() 195 if (inl > 0) { in linebuffer_write() 196 memcpy(&(ctx->obuf[ctx->obuf_len]), in, inl); in linebuffer_write() 197 ctx->obuf_len += inl; in linebuffer_write() [all …]
|
H A D | bf_nbio.c | 110 static int nbiof_write(BIO *b, const char *in, int inl) in nbiof_write() argument 117 if ((in == NULL) || (inl <= 0)) in nbiof_write() 134 if (inl > num) in nbiof_write() 135 inl = num; in nbiof_write() 141 ret = BIO_write(b->next_bio, in, inl); in nbiof_write() 144 nt->lwn = inl; in nbiof_write()
|
/freebsd/crypto/openssl/include/crypto/ |
H A D | evp.h | 308 const unsigned char *in, size_t inl); 356 if (inl < bl) return 1;\ 357 inl -= bl; \ 358 for (i=0; i <= inl; i+=bl) 361 … cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \ 371 … cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \ 373 while(inl>=EVP_MAXCHUNK) {\ 377 inl-=EVP_MAXCHUNK;\ 381 if (inl) {\ 383 …cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, &num… [all …]
|
/freebsd/tools/tools/bhyve/ |
H A D | fwctl_fetch.c | 80 rsplen = inl(FWCTL_IN); in fwctl_op() 87 value = inl(FWCTL_IN); in fwctl_op() 92 value = inl(FWCTL_IN); in fwctl_op() 97 value = inl(FWCTL_IN); in fwctl_op() 108 value = inl(FWCTL_IN); in fwctl_op()
|