Commit 1290b971 authored by Niels Möller's avatar Niels Möller
Browse files

(make_aes_cbc_instance): Use aes_set_encrypt_key

and aes_set_decrypt_key. aes_set_key is obsolete.

Rev: src/crypto.c:1.33
parent 2d4ce374
......@@ -119,11 +119,18 @@ make_aes_cbc_instance(struct crypto_algorithm *algorithm, int mode,
NEW(aes_instance, self);
self->super.block_size = AES_BLOCK_SIZE;
self->super.crypt = ( (mode == CRYPTO_ENCRYPT)
? do_aes_encrypt
: do_aes_decrypt);
aes_set_key(&self->ctx.ctx, algorithm->key_size, key);
if (mode == CRYPTO_ENCRYPT)
{
self->super.crypt = do_aes_encrypt;
aes_set_encrypt_key(&self->ctx.ctx, algorithm->key_size, key);
}
else
{
self->super.crypt = do_aes_decrypt;
aes_set_decrypt_key(&self->ctx.ctx, algorithm->key_size, key);
}
CBC_SET_IV(&self->ctx, iv);
return(&self->super);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment