Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283276
b: refs/heads/master
c: f9d2691
h: refs/heads/master
v: v3
  • Loading branch information
Jussi Kivilinna authored and Herbert Xu committed Nov 9, 2011
1 parent 97746e5 commit cc241b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81559f9ad3d88c033e4ec3b6468012dbfda3b31d
refs/heads/master: f9d2691fc9a00f39b587f965c33cca012a5597bc
8 changes: 5 additions & 3 deletions trunk/crypto/xts.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <crypto/b128ops.h>
#include <crypto/gf128mul.h>

#define XTS_BLOCK_SIZE 16

struct priv {
struct crypto_cipher *child;
struct crypto_cipher *tweak;
Expand Down Expand Up @@ -96,7 +98,7 @@ static int crypt(struct blkcipher_desc *d,
{
int err;
unsigned int avail;
const int bs = crypto_cipher_blocksize(ctx->child);
const int bs = XTS_BLOCK_SIZE;
struct sinfo s = {
.tfm = crypto_cipher_tfm(ctx->child),
.fn = fn
Expand Down Expand Up @@ -177,7 +179,7 @@ static int init_tfm(struct crypto_tfm *tfm)
if (IS_ERR(cipher))
return PTR_ERR(cipher);

if (crypto_cipher_blocksize(cipher) != 16) {
if (crypto_cipher_blocksize(cipher) != XTS_BLOCK_SIZE) {
*flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN;
crypto_free_cipher(cipher);
return -EINVAL;
Expand All @@ -192,7 +194,7 @@ static int init_tfm(struct crypto_tfm *tfm)
}

/* this check isn't really needed, leave it here just in case */
if (crypto_cipher_blocksize(cipher) != 16) {
if (crypto_cipher_blocksize(cipher) != XTS_BLOCK_SIZE) {
crypto_free_cipher(cipher);
crypto_free_cipher(ctx->child);
*flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN;
Expand Down

0 comments on commit cc241b6

Please sign in to comment.