diff options
author | Salman Qazi <sqazi@google.com> | 2012-10-05 17:24:14 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-10-15 10:33:20 -0400 |
commit | ba1ee070909fae01248b8117da1706f3cf2bfd1b (patch) | |
tree | 98d982702fdc17a9699387c59583e9a5ecf0b984 /include/crypto | |
parent | 7291a932c6e27d9768e374e9d648086636daf61c (diff) |
crypto: vmac - Make VMAC work when blocks aren't aligned
VMAC implementation, as it is, does not work with blocks that
are not multiples of 128-bytes. Furthermore, this is a problem
when using the implementation on scatterlists, even
when the complete plain text is 128-byte multiple, as the pieces
that get passed to vmac_update can be pretty much any size.
I also added test cases for unaligned blocks.
Signed-off-by: Salman Qazi <sqazi@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/vmac.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/crypto/vmac.h b/include/crypto/vmac.h index c4467c55df1..6b700c7b2fe 100644 --- a/include/crypto/vmac.h +++ b/include/crypto/vmac.h | |||
@@ -56,6 +56,8 @@ typedef u64 vmac_t; | |||
56 | struct vmac_ctx_t { | 56 | struct vmac_ctx_t { |
57 | struct crypto_cipher *child; | 57 | struct crypto_cipher *child; |
58 | struct vmac_ctx __vmac_ctx; | 58 | struct vmac_ctx __vmac_ctx; |
59 | u8 partial[VMAC_NHBYTES]; /* partial block */ | ||
60 | int partial_size; /* size of the partial block */ | ||
59 | }; | 61 | }; |
60 | 62 | ||
61 | #endif /* __CRYPTO_VMAC_H */ | 63 | #endif /* __CRYPTO_VMAC_H */ |