• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/openssl/crypto/evp/

Lines Matching refs:cipher

75 # define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl)
83 /* ctx->cipher=NULL; */
94 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
97 if (cipher)
99 return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc);
102 int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
120 if (ctx->engine && ctx->cipher && (!cipher ||
121 (cipher
122 && (cipher->nid ==
123 ctx->cipher->nid))))
126 if (cipher) {
132 if (ctx->cipher) {
147 impl = ENGINE_get_cipher_engine(cipher->nid);
150 const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
160 /* We'll use the ENGINE's private cipher definition */
161 cipher = c;
163 * Store the ENGINE functional reference so we know 'cipher' came
174 if (cipher)
175 fcipher = evp_get_fips_cipher(cipher);
177 cipher = fcipher;
178 return FIPS_cipherinit(ctx, cipher, key, iv, enc);
181 ctx->cipher = cipher;
182 if (ctx->cipher->ctx_size) {
183 ctx->cipher_data = OPENSSL_malloc(ctx->cipher->ctx_size);
191 ctx->key_len = cipher->key_len;
194 if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
200 } else if (!ctx->cipher) {
209 return FIPS_cipherinit(ctx, cipher, key, iv, enc);
212 OPENSSL_assert(ctx->cipher->block_size == 1
213 || ctx->cipher->block_size == 8
214 || ctx->cipher->block_size == 16);
257 if (key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
258 if (!ctx->cipher->init(ctx, key, iv, enc))
263 ctx->block_mask = ctx->cipher->block_size - 1;
292 int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
295 return EVP_CipherInit(ctx, cipher, key, iv, 1);
298 int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
302 return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1);
305 int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
308 return EVP_CipherInit(ctx, cipher, key, iv, 0);
311 int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
315 return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0);
323 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
347 bl = ctx->cipher->block_size;
393 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
402 b = ctx->cipher->block_size;
436 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
454 b = ctx->cipher->block_size;
497 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
506 b = ctx->cipher->block_size;
538 n = ctx->cipher->block_size - n;
558 if (c->cipher != NULL) {
559 if (c->cipher->cleanup && !c->cipher->cleanup(c))
561 /* Cleanse cipher context data */
563 OPENSSL_cleanse(c->cipher_data, c->cipher->ctx_size);
585 if (c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH)
589 if ((keylen > 0) && (c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) {
609 if (!ctx->cipher) {
614 if (!ctx->cipher->ctrl) {
619 ret = ctx->cipher->ctrl(ctx, type, arg, ptr);
630 if (ctx->cipher->flags & EVP_CIPH_RAND_KEY)
639 if ((in == NULL) || (in->cipher == NULL)) {
644 /* Make sure it's safe to copy a cipher context using an ENGINE */
654 if (in->cipher_data && in->cipher->ctx_size) {
655 out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size);
660 memcpy(out->cipher_data, in->cipher_data, in->cipher->ctx_size);
663 if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY)
664 return in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out);