Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Kernel bump from 4.1.3-rt to 4.1.7-rt.
[kvmfornfv.git]
/
kernel
/
drivers
/
crypto
/
nx
/
nx-aes-ctr.c
diff --git
a/kernel/drivers/crypto/nx/nx-aes-ctr.c
b/kernel/drivers/crypto/nx/nx-aes-ctr.c
index
2617cd4
..
dd7e9f3
100644
(file)
--- a/
kernel/drivers/crypto/nx/nx-aes-ctr.c
+++ b/
kernel/drivers/crypto/nx/nx-aes-ctr.c
@@
-72,7
+72,7
@@
static int ctr3686_aes_nx_set_key(struct crypto_tfm *tfm,
if (key_len < CTR_RFC3686_NONCE_SIZE)
return -EINVAL;
if (key_len < CTR_RFC3686_NONCE_SIZE)
return -EINVAL;
- memcpy(nx_ctx->priv.ctr.
iv
,
+ memcpy(nx_ctx->priv.ctr.
nonce
,
in_key + key_len - CTR_RFC3686_NONCE_SIZE,
CTR_RFC3686_NONCE_SIZE);
in_key + key_len - CTR_RFC3686_NONCE_SIZE,
CTR_RFC3686_NONCE_SIZE);
@@
-131,14
+131,15
@@
static int ctr3686_aes_nx_crypt(struct blkcipher_desc *desc,
unsigned int nbytes)
{
struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm);
unsigned int nbytes)
{
struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm);
- u8
*iv = nx_ctx->priv.ctr.iv
;
+ u8
iv[16]
;
+ memcpy(iv, nx_ctx->priv.ctr.nonce, CTR_RFC3686_IV_SIZE);
memcpy(iv + CTR_RFC3686_NONCE_SIZE,
desc->info, CTR_RFC3686_IV_SIZE);
iv[12] = iv[13] = iv[14] = 0;
iv[15] = 1;
memcpy(iv + CTR_RFC3686_NONCE_SIZE,
desc->info, CTR_RFC3686_IV_SIZE);
iv[12] = iv[13] = iv[14] = 0;
iv[15] = 1;
- desc->info =
nx_ctx->priv.ctr.
iv;
+ desc->info = iv;
return ctr_aes_nx_crypt(desc, dst, src, nbytes);
}
return ctr_aes_nx_crypt(desc, dst, src, nbytes);
}