• Home
  • Raw
  • Download

Lines Matching refs:cipher

75 #define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl)
95 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, in EVP_CipherInit() argument
98 if (cipher) in EVP_CipherInit()
100 return EVP_CipherInit_ex(ctx,cipher,NULL,key,iv,enc); in EVP_CipherInit()
103 int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, in EVP_CipherInit_ex() argument
119 if (ctx->engine && ctx->cipher && (!cipher || in EVP_CipherInit_ex()
120 (cipher && (cipher->nid == ctx->cipher->nid)))) in EVP_CipherInit_ex()
123 if (cipher) in EVP_CipherInit_ex()
128 if (ctx->cipher) in EVP_CipherInit_ex()
147 impl = ENGINE_get_cipher_engine(cipher->nid); in EVP_CipherInit_ex()
151 const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid); in EVP_CipherInit_ex()
162 cipher = c; in EVP_CipherInit_ex()
174 return FIPS_cipherinit(ctx, cipher, key, iv, enc); in EVP_CipherInit_ex()
176 ctx->cipher=cipher; in EVP_CipherInit_ex()
177 if (ctx->cipher->ctx_size) in EVP_CipherInit_ex()
179 ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size); in EVP_CipherInit_ex()
190 ctx->key_len = cipher->key_len; in EVP_CipherInit_ex()
192 if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT) in EVP_CipherInit_ex()
201 else if(!ctx->cipher) in EVP_CipherInit_ex()
211 return FIPS_cipherinit(ctx, cipher, key, iv, enc); in EVP_CipherInit_ex()
214 OPENSSL_assert(ctx->cipher->block_size == 1 in EVP_CipherInit_ex()
215 || ctx->cipher->block_size == 8 in EVP_CipherInit_ex()
216 || ctx->cipher->block_size == 16); in EVP_CipherInit_ex()
252 if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { in EVP_CipherInit_ex()
253 if(!ctx->cipher->init(ctx,key,iv,enc)) return 0; in EVP_CipherInit_ex()
257 ctx->block_mask=ctx->cipher->block_size-1; in EVP_CipherInit_ex()
283 int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, in EVP_EncryptInit() argument
286 return EVP_CipherInit(ctx, cipher, key, iv, 1); in EVP_EncryptInit()
289 int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, in EVP_EncryptInit_ex() argument
292 return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1); in EVP_EncryptInit_ex()
295 int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, in EVP_DecryptInit() argument
298 return EVP_CipherInit(ctx, cipher, key, iv, 0); in EVP_DecryptInit()
301 int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, in EVP_DecryptInit_ex() argument
304 return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0); in EVP_DecryptInit_ex()
312 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) in EVP_EncryptUpdate()
342 bl=ctx->cipher->block_size; in EVP_EncryptUpdate()
392 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) in EVP_EncryptFinal_ex()
402 b=ctx->cipher->block_size; in EVP_EncryptFinal_ex()
439 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) in EVP_DecryptUpdate()
461 b=ctx->cipher->block_size; in EVP_DecryptUpdate()
507 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) in EVP_DecryptFinal_ex()
517 b=ctx->cipher->block_size; in EVP_DecryptFinal_ex()
550 n=ctx->cipher->block_size-n; in EVP_DecryptFinal_ex()
572 if (c->cipher != NULL) in EVP_CIPHER_CTX_cleanup()
574 if(c->cipher->cleanup && !c->cipher->cleanup(c)) in EVP_CIPHER_CTX_cleanup()
578 OPENSSL_cleanse(c->cipher_data, c->cipher->ctx_size); in EVP_CIPHER_CTX_cleanup()
598 if(c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH) in EVP_CIPHER_CTX_set_key_length()
601 if((keylen > 0) && (c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) in EVP_CIPHER_CTX_set_key_length()
620 if(!ctx->cipher) { in EVP_CIPHER_CTX_ctrl()
625 if(!ctx->cipher->ctrl) { in EVP_CIPHER_CTX_ctrl()
630 ret = ctx->cipher->ctrl(ctx, type, arg, ptr); in EVP_CIPHER_CTX_ctrl()
640 if (ctx->cipher->flags & EVP_CIPH_RAND_KEY) in EVP_CIPHER_CTX_rand_key()
649 if ((in == NULL) || (in->cipher == NULL)) in EVP_CIPHER_CTX_copy()
666 if (in->cipher_data && in->cipher->ctx_size) in EVP_CIPHER_CTX_copy()
668 out->cipher_data=OPENSSL_malloc(in->cipher->ctx_size); in EVP_CIPHER_CTX_copy()
674 memcpy(out->cipher_data,in->cipher_data,in->cipher->ctx_size); in EVP_CIPHER_CTX_copy()
677 if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY) in EVP_CIPHER_CTX_copy()
678 return in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out); in EVP_CIPHER_CTX_copy()