summaryrefslogtreecommitdiff
path: root/crypto/testmgr.h
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2022-03-03 12:13:10 -0800
committerJens Axboe <axboe@kernel.dk>2022-03-07 12:48:35 -0700
commit547a998d5ae0edddfd2ca41a9b8b4175d0e1c12b (patch)
tree17ad83295d3798527a0525618b8e9a45b829f129 /crypto/testmgr.h
parent24eb1f589f4f6dcb1e6e676c4256cbc246b8ac39 (diff)
downloadlinux-crypto-547a998d5ae0edddfd2ca41a9b8b4175d0e1c12b.tar.gz
linux-crypto-547a998d5ae0edddfd2ca41a9b8b4175d0e1c12b.zip
crypto: add rocksoft 64b crc guard tag framework
Hardware specific features may be able to calculate a crc64, so provide a framework for drivers to register their implementation. If nothing is registered, fallback to the generic table lookup implementation. The implementation is modeled after the crct10dif equivalent. Signed-off-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20220303201312.3255347-7-kbusch@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'crypto/testmgr.h')
-rw-r--r--crypto/testmgr.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index a253d66b..f1a22794 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -3679,6 +3679,21 @@ static const struct hash_testvec rmd160_tv_template[] = {
}
};
+static const u8 zeroes[4096] = { [0 ... 4095] = 0 };
+static const u8 ones[4096] = { [0 ... 4095] = 0xff };
+
+static const struct hash_testvec crc64_rocksoft_tv_template[] = {
+ {
+ .plaintext = zeroes,
+ .psize = 4096,
+ .digest = (u8 *)(u64[]){ 0x6482d367eb22b64eull },
+ }, {
+ .plaintext = ones,
+ .psize = 4096,
+ .digest = (u8 *)(u64[]){ 0xc0ddba7302eca3acull },
+ }
+};
+
static const struct hash_testvec crct10dif_tv_template[] = {
{
.plaintext = "abc",