]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: vmac - add nonced version with big endian digest
authorEric Biggers <ebiggers@google.com>
Mon, 18 Jun 2018 17:22:39 +0000 (10:22 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 1 Jul 2018 13:00:43 +0000 (21:00 +0800)
commit8e0b7e0702199f5f890bde282ea16aeb7935a2aa
tree7d9daa5ac6b7d61166803e51458e8f512ae88013
parentd1ec7ed8f07d782698f32f450d723b3c5f3b0021
crypto: vmac - add nonced version with big endian digest

Currently the VMAC template uses a "nonce" hardcoded to 0, which makes
it insecure unless a unique key is set for every message.  Also, the
endianness of the final digest is wrong: the implementation uses little
endian, but the VMAC specification has it as big endian, as do other
VMAC implementations such as the one in Crypto++.

Add a new VMAC template where the nonce is passed as the first 16 bytes
of data (similar to what is done for Poly1305's nonce), and the digest
is big endian.  Call it "vmac64", since the old name of simply "vmac"
didn't clarify whether the implementation is of VMAC-64 or of VMAC-128
(which produce 64-bit and 128-bit digests respectively); so we fix the
naming ambiguity too.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c
crypto/testmgr.h
crypto/vmac.c